You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<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
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Static Vec fails on Rust 0.11.0 without friendly error
Static Vec fails on Rust 0.11.0 with ugly error
Jul 13, 2014
This is a consequence of using a macro for something like this. There are already some bugs about improving macro expansion errors, and I don't think there's a unique aspect to this error.
feat: Prioritize import suggestions based on the expected type
Hi, this is a draft PR to solve rust-lang#15384. `Adt` types work and now I have a few questions :)
1. What other types make sense in this context? Looking at [ModuleDef](https://github.com/rust-lang/rust-analyzer/blob/05666441bafd6010787a4097a6bd44266ad21018/crates/hir/src/lib.rs#L275) I am thinking everything except Modules.
2. Is there an existing way of converting between `ModeuleDef` and `hir::Type` in the rustanalyzer code base?
3. Does this approach seem sound to you?
Ups: Upon writing this I just realised that the enum test is invalided as there are no enum variants and this no variant is passed as a function argument.
Code:
static val: Vec<u64> = vec!(1, 2, 3);
Errors:
The text was updated successfully, but these errors were encountered: