diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-12 18:04:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-12 18:04:08 +0100 |
| commit | ebe36ac81516fe9cc2c4e924f3abfaeb2c14cb3e (patch) | |
| tree | df2c5494641739117b08f54bd3f264c4339848c0 /compiler/rustc_const_eval/src | |
| parent | 733f93d60c954f53f21b4640fcd089f6f5e4035b (diff) | |
| parent | 2bcbc16caf17351ef3f8d5e9faee98b48387d589 (diff) | |
| download | rust-ebe36ac81516fe9cc2c4e924f3abfaeb2c14cb3e.tar.gz rust-ebe36ac81516fe9cc2c4e924f3abfaeb2c14cb3e.zip | |
Rollup merge of #120917 - chenyukang:yukang-dead-parameters, r=compiler-errors
Remove a bunch of dead parameters in functions Found this kind of issue when working on https://github.com/rust-lang/rust/pull/119650 I wrote a trivial toy lint and manual review to find these.
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/check_consts/resolver.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/resolver.rs b/compiler/rustc_const_eval/src/transform/check_consts/resolver.rs index a23922c778f..2c835f6750f 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/resolver.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/resolver.rs @@ -96,7 +96,7 @@ where }); } - fn address_of_allows_mutation(&self, _mt: mir::Mutability, _place: mir::Place<'tcx>) -> bool { + fn address_of_allows_mutation(&self) -> bool { // Exact set of permissions granted by AddressOf is undecided. Conservatively assume that // it might allow mutation until resolution of #56604. true @@ -171,10 +171,8 @@ where self.super_rvalue(rvalue, location); match rvalue { - mir::Rvalue::AddressOf(mt, borrowed_place) => { - if !borrowed_place.is_indirect() - && self.address_of_allows_mutation(*mt, *borrowed_place) - { + mir::Rvalue::AddressOf(_mt, borrowed_place) => { + if !borrowed_place.is_indirect() && self.address_of_allows_mutation() { let place_ty = borrowed_place.ty(self.ccx.body, self.ccx.tcx).ty; if Q::in_any_value_of_ty(self.ccx, place_ty) { self.state.qualif.insert(borrowed_place.local); |
