1
Fork 0

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

@ -863,7 +863,7 @@ impl<'tcx> InferCtxt<'tcx> {
}
#[instrument(skip(self, snapshot), level = "debug")]
fn rollback_to(&self, cause: &str, snapshot: CombinedSnapshot<'tcx>) {
fn rollback_to(&self, snapshot: CombinedSnapshot<'tcx>) {
let CombinedSnapshot { undo_snapshot, region_constraints_snapshot, universe } = snapshot;
self.universe.set(universe);
@ -895,7 +895,7 @@ impl<'tcx> InferCtxt<'tcx> {
self.commit_from(snapshot);
}
Err(_) => {
self.rollback_to("commit_if_ok -- error", snapshot);
self.rollback_to(snapshot);
}
}
r
@ -909,7 +909,7 @@ impl<'tcx> InferCtxt<'tcx> {
{
let snapshot = self.start_snapshot();
let r = f(&snapshot);
self.rollback_to("probe", snapshot);
self.rollback_to(snapshot);
r
}

View file

@ -327,7 +327,6 @@ impl<'tcx> InferCtxt<'tcx> {
#[instrument(level = "debug", skip(self))]
pub fn register_member_constraints(
&self,
param_env: ty::ParamEnv<'tcx>,
opaque_type_key: OpaqueTypeKey<'tcx>,
concrete_ty: Ty<'tcx>,
span: Span,

View file

@ -221,11 +221,11 @@ impl<'tcx> InferCtxt<'tcx> {
}
(ty::ConstKind::Infer(InferConst::Var(vid)), _) => {
return self.unify_const_variable(vid, b, relation.param_env());
return self.unify_const_variable(vid, b);
}
(_, ty::ConstKind::Infer(InferConst::Var(vid))) => {
return self.unify_const_variable(vid, a, relation.param_env());
return self.unify_const_variable(vid, a);
}
(ty::ConstKind::Infer(InferConst::EffectVar(vid)), _) => {
@ -298,7 +298,6 @@ impl<'tcx> InferCtxt<'tcx> {
&self,
target_vid: ty::ConstVid,
ct: ty::Const<'tcx>,
param_env: ty::ParamEnv<'tcx>,
) -> RelateResult<'tcx, ty::Const<'tcx>> {
let span = match self.inner.borrow_mut().const_unification_table().probe_value(target_vid) {
ConstVariableValue::Known { value } => {