Skip to content

Commit aa35530

Browse files
committed
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
1 parent b6cfe71 commit aa35530

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
15521552
/// When encountering an equality constraint in a `where` clause, emit an error. If the code seems
15531553
/// like it's setting an associated type, provide an appropriate suggestion.
15541554
fn deny_equality_constraints(
1555-
this: &mut AstValidator<'_>,
1555+
this: &AstValidator<'_>,
15561556
predicate: &WhereEqPredicate,
15571557
generics: &Generics,
15581558
) {

compiler/rustc_expand/src/expand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
871871
let mut parser = self.cx.new_parser_from_tts(toks);
872872
match parse_ast_fragment(&mut parser, kind) {
873873
Ok(fragment) => {
874-
ensure_complete_parse(&mut parser, path, kind.name(), span);
874+
ensure_complete_parse(&parser, path, kind.name(), span);
875875
fragment
876876
}
877877
Err(mut err) => {
@@ -958,7 +958,7 @@ pub fn parse_ast_fragment<'a>(
958958
}
959959

960960
pub fn ensure_complete_parse<'a>(
961-
parser: &mut Parser<'a>,
961+
parser: &Parser<'a>,
962962
macro_path: &ast::Path,
963963
kind_name: &str,
964964
span: Span,

compiler/rustc_infer/src/infer/snapshot/fudge.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use ut::UnifyKey;
1313
use std::ops::Range;
1414

1515
fn vars_since_snapshot<'tcx, T>(
16-
table: &mut UnificationTable<'_, 'tcx, T>,
16+
table: &UnificationTable<'_, 'tcx, T>,
1717
snapshot_var_len: usize,
1818
) -> Range<T>
1919
where
@@ -124,11 +124,11 @@ impl<'tcx> InferCtxt<'tcx> {
124124
let type_vars =
125125
inner.type_variables().vars_since_snapshot(variable_lengths.type_var_len);
126126
let int_vars = vars_since_snapshot(
127-
&mut inner.int_unification_table(),
127+
&inner.int_unification_table(),
128128
variable_lengths.int_var_len,
129129
);
130130
let float_vars = vars_since_snapshot(
131-
&mut inner.float_unification_table(),
131+
&inner.float_unification_table(),
132132
variable_lengths.float_var_len,
133133
);
134134
let region_vars = inner

compiler/rustc_session/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ pub fn parse_crate_edition(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches
20102010
}
20112011

20122012
fn check_error_format_stability(
2013-
early_dcx: &mut EarlyDiagCtxt,
2013+
early_dcx: &EarlyDiagCtxt,
20142014
unstable_opts: &UnstableOptions,
20152015
error_format: ErrorOutputType,
20162016
) {
@@ -2574,7 +2574,7 @@ fn parse_remap_path_prefix(
25742574
}
25752575

25762576
fn parse_logical_env(
2577-
early_dcx: &mut EarlyDiagCtxt,
2577+
early_dcx: &EarlyDiagCtxt,
25782578
matches: &getopts::Matches,
25792579
) -> FxIndexMap<String, String> {
25802580
let mut vars = FxIndexMap::default();

0 commit comments

Comments
 (0)