Skip to content

Commit c1324cd

Browse files
Remove tag field from relations
1 parent 5753b30 commit c1324cd

File tree

9 files changed

+7
-37
lines changed

9 files changed

+7
-37
lines changed

compiler/rustc_borrowck/src/type_check/relate_tys.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,6 @@ impl<'bccx, 'tcx> TypeRelation<TyCtxt<'tcx>> for NllTypeRelating<'_, 'bccx, 'tcx
313313
self.type_checker.infcx.tcx
314314
}
315315

316-
fn tag(&self) -> &'static str {
317-
"nll::subtype"
318-
}
319-
320316
#[instrument(skip(self, info), level = "trace", ret)]
321317
fn relate_with_variance<T: Relate<TyCtxt<'tcx>>>(
322318
&mut self,

compiler/rustc_infer/src/error_reporting/infer/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,10 +1934,6 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for SameTypeModuloInfer<'_, 'tcx> {
19341934
self.0.tcx
19351935
}
19361936

1937-
fn tag(&self) -> &'static str {
1938-
"SameTypeModuloInfer"
1939-
}
1940-
19411937
fn relate_with_variance<T: relate::Relate<TyCtxt<'tcx>>>(
19421938
&mut self,
19431939
_variance: ty::Variance,

compiler/rustc_infer/src/infer/outlives/test_type_match.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ impl<'tcx> MatchAgainstHigherRankedOutlives<'tcx> {
133133
}
134134

135135
impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstHigherRankedOutlives<'tcx> {
136-
fn tag(&self) -> &'static str {
137-
"MatchAgainstHigherRankedOutlives"
138-
}
139-
140136
fn cx(&self) -> TyCtxt<'tcx> {
141137
self.tcx
142138
}

compiler/rustc_infer/src/infer/relate/generalize.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,6 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
401401
self.infcx.tcx
402402
}
403403

404-
fn tag(&self) -> &'static str {
405-
"Generalizer"
406-
}
407-
408404
fn relate_item_args(
409405
&mut self,
410406
item_def_id: DefId,

compiler/rustc_infer/src/infer/relate/glb.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ impl<'combine, 'infcx, 'tcx> Glb<'combine, 'infcx, 'tcx> {
2323
}
2424

2525
impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Glb<'_, '_, 'tcx> {
26-
fn tag(&self) -> &'static str {
27-
"Glb"
28-
}
29-
3026
fn cx(&self) -> TyCtxt<'tcx> {
3127
self.fields.tcx()
3228
}

compiler/rustc_infer/src/infer/relate/lub.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ impl<'combine, 'infcx, 'tcx> Lub<'combine, 'infcx, 'tcx> {
2323
}
2424

2525
impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Lub<'_, '_, 'tcx> {
26-
fn tag(&self) -> &'static str {
27-
"Lub"
28-
}
29-
3026
fn cx(&self) -> TyCtxt<'tcx> {
3127
self.fields.tcx()
3228
}

compiler/rustc_infer/src/infer/relate/type_relating.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ impl<'combine, 'infcx, 'tcx> TypeRelating<'combine, 'infcx, 'tcx> {
2828
}
2929

3030
impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> {
31-
fn tag(&self) -> &'static str {
32-
"TypeRelating"
33-
}
34-
3531
fn cx(&self) -> TyCtxt<'tcx> {
3632
self.fields.infcx.tcx
3733
}

compiler/rustc_trait_selection/src/traits/select/_match.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ impl<'tcx> MatchAgainstFreshVars<'tcx> {
3232
}
3333

3434
impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstFreshVars<'tcx> {
35-
fn tag(&self) -> &'static str {
36-
"MatchAgainstFreshVars"
37-
}
38-
3935
fn cx(&self) -> TyCtxt<'tcx> {
4036
self.tcx
4137
}

compiler/rustc_type_ir/src/relate.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ impl<I: Interner> VarianceDiagInfo<I> {
5858
pub trait TypeRelation<I: Interner>: Sized {
5959
fn cx(&self) -> I;
6060

61-
/// Returns a static string we can use for printouts.
62-
fn tag(&self) -> &'static str;
63-
6461
/// Generic relation routine suitable for most anything.
6562
fn relate<T: Relate<I>>(&mut self, a: T, b: T) -> RelateResult<I, T> {
6663
Relate::relate(self, a, b)
@@ -571,15 +568,20 @@ pub fn structurally_relate_consts<I: Interner, R: TypeRelation<I>>(
571568
mut a: I::Const,
572569
mut b: I::Const,
573570
) -> RelateResult<I, I::Const> {
574-
debug!("{}.structurally_relate_consts(a = {:?}, b = {:?})", relation.tag(), a, b);
571+
debug!("{}.structurally_relate_consts(a = {:?}, b = {:?})", std::any::type_name::<R>(), a, b);
575572
let cx = relation.cx();
576573

577574
if cx.features().generic_const_exprs() {
578575
a = cx.expand_abstract_consts(a);
579576
b = cx.expand_abstract_consts(b);
580577
}
581578

582-
debug!("{}.structurally_relate_consts(normed_a = {:?}, normed_b = {:?})", relation.tag(), a, b);
579+
debug!(
580+
"{}.structurally_relate_consts(normed_a = {:?}, normed_b = {:?})",
581+
std::any::type_name::<R>(),
582+
a,
583+
b
584+
);
583585

584586
// Currently, the values that can be unified are primitive types,
585587
// and those that derive both `PartialEq` and `Eq`, corresponding

0 commit comments

Comments
 (0)