-
Notifications
You must be signed in to change notification settings - Fork 2k
Fails to identify type of vec![] macro #6837
Copy link
Copy link
Closed
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionE-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Metadata
Metadata
Assignees
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionE-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Type
Fields
Give feedbackNo fields configured for issues without a type.
In an empty (latest rust-analyzer, nightly rust) VSCode project, I am getting the following (related) errors to do with the


vec!macro.It seems as if rust-analyzer is maybe unable to resolve the second type parameter related to the new allocator API, and that error stops it from filling in the first parameter. Weirdly, it semi-correctly identifies a
charin the following image, but thinks that it is part of an array.It also identifies
vec!["];to be aVec<[&str; _]>.This is probably not a direct repeat of #6668 - I'm using a nightly version of rust-analyzer released after that issue was patched. Also, using the normal
Vecconstructor, and adding elements in afterwards, works fine thanks to type inference - it's only a problem with the macro, it seems.