Skip to content

Static Vec fails on Rust 0.11.0 with ugly error #15627

@ghost

Description

Code: static val: Vec<u64> = vec!(1, 2, 3);
Errors:

<std macros>:4:25: 4:47 error: static items are not allowed to have destructors
<std macros>:4         let mut _temp = ::std::vec::Vec::new();
                                       ^~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 9:2 note: in expansion of vec!
euler/primes.rs:1:26: 1:40 note: expansion site
<std macros>:5:11: 5:16 error: static items are not allowed to have destructors
<std macros>:5         $(_temp.push($e);)*
                         ^~~~~
<std macros>:1:1: 9:2 note: in expansion of vec!
euler/primes.rs:1:26: 1:40 note: expansion site
<std macros>:5:11: 5:16 error: static items are not allowed to have destructors
<std macros>:5         $(_temp.push($e);)*
                         ^~~~~
<std macros>:1:1: 9:2 note: in expansion of vec!
euler/primes.rs:1:26: 1:40 note: expansion site
<std macros>:5:11: 5:16 error: static items are not allowed to have destructors
<std macros>:5         $(_temp.push($e);)*
                         ^~~~~
<std macros>:1:1: 9:2 note: in expansion of vec!
euler/primes.rs:1:26: 1:40 note: expansion site
<std macros>:6:9: 6:14 error: static items are not allowed to have destructors
<std macros>:6         _temp
                       ^~~~~
<std macros>:1:1: 9:2 note: in expansion of vec!
euler/primes.rs:1:26: 1:40 note: expansion site
error: aborting due to 5 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions