-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.
Description
This code: (Playground link)
fn main() {
let tiles = Default::default();
for row in &mut tiles {
for tile in row {
*tile = 0;
}
}
let tiles: [[usize; 3]; 3] = tiles;
}
Fails with this error:
error[E0282]: type annotations needed
--> src/main.rs:5:13
|
4 | for tile in row {
| ---- consider giving `__next` a type
5 | *tile = 0;
| ^^^^^ cannot infer type for `_`
Type inference (rightfully) fails on this code. However, the variable that it suggests fixing is called __next
and does not actually exist in my code. It is probably some internal variable generated by the compiler.
varkor
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.