Skip to content

unused_mut lint doesn't cover every case #43526

Closed
@CryZe

Description

@CryZe
fn main() {
    let mut x = &mut 5;
    *x = 4;
    println!("{}", x);
}

Playground

This does not print a warning that x doesn't need to be mutable, even though the binding never changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions