Skip to content

E0282 suggests changing desugared loop variable to __next #52415

Closed
@estebank

Description

@estebank
fn main() {
    for (ref i,) in [].iter() {
        i.clone();
    }
}
error[E0282]: type annotations needed
  --> $DIR/issue-20261.rs:14:11
   |
LL |     for (ref i,) in [].iter() {
   |         -------- consider giving `__next` a type
LL |         i.clone();
   |           ^^^^^ cannot infer type for `_`
   |
= note: type must be known at this point

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions