Rollup merge of #120590 - compiler-errors:dead, r=Nilstrieb

Remove unused args from functions

`#[instrument]` suppresses the unused arguments from a function, *and* suppresses unused methods too! This PR removes things which are only used via `#[instrument]` calls, and fixes some other errors (privacy?) that I will comment inline.

It's possible that some of these arguments were being passed in for the purposes of being instrumented, but I am unconvinced by most of them.
This commit is contained in:
Matthias Krüger 2024-02-08 20:34:57 +01:00 committed by GitHub
commit 4ffb1a7f3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 32 additions and 124 deletions

View file

@ -541,12 +541,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
}
#[instrument(level = "trace", skip(self), ret)]
fn eval_rvalue(
&mut self,
rvalue: &Rvalue<'tcx>,
location: Location,
dest: &Place<'tcx>,
) -> Option<()> {
fn eval_rvalue(&mut self, rvalue: &Rvalue<'tcx>, dest: &Place<'tcx>) -> Option<()> {
if !dest.projection.is_empty() {
return None;
}
@ -734,7 +729,7 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
_ if place.is_indirect() => {}
ConstPropMode::NoPropagation => self.ensure_not_propagated(place.local),
ConstPropMode::OnlyInsideOwnBlock | ConstPropMode::FullConstProp => {
if self.eval_rvalue(rvalue, location, place).is_none() {
if self.eval_rvalue(rvalue, place).is_none() {
// Const prop failed, so erase the destination, ensuring that whatever happens
// from here on, does not know about the previous value.
// This is important in case we have