1
Fork 0

compiler: fix few needless_pass_by_ref_mut clippy lints

warning: this argument is a mutable reference, but not used mutably
    --> compiler\rustc_session\src\config.rs:2013:16
     |
2013 |     early_dcx: &mut EarlyDiagCtxt,
     |                ^^^^^^^^^^^^^^^^^^ help: consider changing to: `&EarlyDiagCtxt`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
    --> compiler\rustc_ast_passes\src\ast_validation.rs:1555:11
     |
1555 |     this: &mut AstValidator<'_>,
     |           ^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&AstValidator<'_>`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
  --> compiler\rustc_infer\src\infer\snapshot\fudge.rs:16:12
   |
16 |     table: &mut UnificationTable<'_, 'tcx, T>,
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&UnificationTable<'_, 'tcx, T>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
   --> compiler\rustc_expand\src\expand.rs:961:13
    |
961 |     parser: &mut Parser<'a>,
    |             ^^^^^^^^^^^^^^^ help: consider changing to: `&Parser<'a>`
    |
    = warning: changing this function will impact semver compatibility
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
This commit is contained in:
klensy 2024-03-28 11:30:49 +03:00
parent b6cfe71f38
commit aa35530319
4 changed files with 8 additions and 8 deletions

View file

@ -13,7 +13,7 @@ use ut::UnifyKey;
use std::ops::Range;
fn vars_since_snapshot<'tcx, T>(
table: &mut UnificationTable<'_, 'tcx, T>,
table: &UnificationTable<'_, 'tcx, T>,
snapshot_var_len: usize,
) -> Range<T>
where
@ -124,11 +124,11 @@ impl<'tcx> InferCtxt<'tcx> {
let type_vars =
inner.type_variables().vars_since_snapshot(variable_lengths.type_var_len);
let int_vars = vars_since_snapshot(
&mut inner.int_unification_table(),
&inner.int_unification_table(),
variable_lengths.int_var_len,
);
let float_vars = vars_since_snapshot(
&mut inner.float_unification_table(),
&inner.float_unification_table(),
variable_lengths.float_var_len,
);
let region_vars = inner