Skip to content

[ER] Uplift clippy::unnecessary_mut_passed #83409

Open
@leonardo-m

Description

@leonardo-m

I think it's worth moving the clippy::unnecessary_mut_passed lint into rustc because it's a very basic coding mistake:

#![allow(unused_variables)]
fn foo(x: &u32) {}
fn bar(a: &[u32]) {}
fn spam(a: &[u32; 10]) {}
fn main() {
    foo(&mut 10);
    let mut a = [0_u32; 10];
    bar(&mut a[..]);
    spam(&mut a);
}

See also, for further improvements:
rust-lang/rust-clippy#5546

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions