Skip to content

just clippy fails due to unnecessary_mut_passed in mir-lower's lowering_test.rs #401

Closed

Description

@SomeB1oody

The repo's clippy gate fails on main:

just clippy # i.e. cargo clippy --all-targets --lib --tests -- -D warnings

Output (10 identical errors, all in the same file):

error: the function `IntegerType::get` doesn't need a mutable reference
   --> crates/mir-lower/tests/lowering_test.rs:813:35
    |
813 |     let i32_ty = IntegerType::get(&mut ctx, 32, Signedness::Signless);
    |                                   ^^^^^^^^
    |
    = note: `-D clippy::unnecessary-mut-passed` implied by `-D warnings`

...

error: could not compile `mir-lower` (test "lowering_test") due to 10 previous errors

pliron's IntegerType::get takes &Context, but ten call sites in crates/mir-lower/tests/lowering_test.rs pass &mut ctx. Rust accepts the implicit downgrade, but clippy's unnecessary_mut_passed lint flags it.

It survives on main because the CI clippy job runs cargo clippy --workspace -- -D warnings without --all-targets/--tests, so test targets are never linted there.

Unrelated to #368, which fixes different lints confined to difftest's backends.rs.

Activity

  1. honeyspoon commented on Jul 24, 2026

    @honeyspoon
    Contributor

    This appears to already be resolved on main. Running cargo clippy -p mir-lower --all-targets -- -D warnings on the current HEAD (commit fe4791d5) completes cleanly with no unnecessary_mut_passed warnings.

    The fix likely landed as part of an upstream commit that changed the &mut ctx → &ctx calls in lowering_test.rs.

  2. added a commit that references this issue on Jul 27, 2026
    b392c9a
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions