Skip to content

Commit

Permalink
Auto merge of #12065 - loongarch-rs:fix-unused-mut, r=weihanglo
Browse files Browse the repository at this point in the history
Fix warning with unused mut

### What does this PR try to resolve?

```
warning: variable does not need to be mutable
   --> src/cargo/core/compiler/unit_dependencies.rs:152:5
    |
152 |     mut state: &mut State<'_, '_>,
    |     ----^^^^^
    |     |
    |     help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: `cargo` (lib) generated 1 warning (run `cargo fix --lib -p cargo` to apply 1 suggestion)
```

This is caused by rust-lang/rust#110960

### How should we test and review this PR?

Running the mainline rust toolchain and `cargo build` without any wanrning messages would look like the above.

### Additional information

None
  • Loading branch information
bors committed May 1, 2023
2 parents 393ce5b + b0a3103 commit ee7f4c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/unit_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub fn build_unit_dependencies<'a, 'cfg>(

/// Compute all the dependencies for the standard library.
fn calc_deps_of_std(
mut state: &mut State<'_, '_>,
state: &mut State<'_, '_>,
std_roots: &HashMap<CompileKind, Vec<Unit>>,
) -> CargoResult<Option<UnitGraph>> {
if std_roots.is_empty() {
Expand Down

0 comments on commit ee7f4c3

Please sign in to comment.