Skip to content

[ER] Uplift clippy::unnecessary_mut_passed #83409

Open

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

Activity

  1. clubby789 commented on Mar 30, 2023

    @clubby789
    Contributor

    @rustbot label +A-lint

  2. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Mar 30, 2023
  3. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    and removed
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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