Skip to content

false positive for mut-mut when mutably borrowing iterator #939

Closed
@oli-obk

Description

@oli-obk

The span is on the for loop, so maybe it's occurring inside the expansion?

    let array = [5, 6, 7, 8, 9];
    let mut args = array.iter().skip(2);
    for &arg in &mut args {
        println!("{}", arg);
        if arg == 8 {
            break;
        }
    }
    for arg in args {
        println!(":{}", arg);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions