-
Notifications
You must be signed in to change notification settings - Fork 2k
"Insert explicit type" suggestion produces invalid code for array #2922
Copy link
Copy link
Closed
Labels
A-assistsS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
For arrays, ra produces an invalid suggestion to insert [T;_], where T is a concrete type, but _ is literally an underscore, which is not valid in that position.
Example:
let x = [0.0; 3];produces a suggestion that when applied results in
let x: [f64;_] = [0.0; 3];which leads to the error message
error: expected expression, found reserved identifier `_`
--> src/file.rs:line:col
|
col | let x: [f64;_] = [0.0; 3];
| - ^ expected expression
| |
| while parsing the type for `x`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-assistsS-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.