Skip to content

Commit d1ed286

Browse files
rename, add inline
1 parent 3a5bf11 commit d1ed286

File tree

11 files changed

+29
-17
lines changed

11 files changed

+29
-17
lines changed

compiler/rustc_hir_analysis/src/check/dropck.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ impl<'tcx> TypeRelation<'tcx> for SimpleEqRelation<'tcx> {
248248
self.param_env
249249
}
250250

251-
fn fast_equate_combine(&self) -> bool {
251+
#[inline]
252+
fn fast_equate(&self) -> bool {
252253
true
253254
}
254255

compiler/rustc_infer/src/infer/combine.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
525525
self.param_env
526526
}
527527

528-
fn fast_equate_combine(&self) -> bool {
528+
#[inline]
529+
fn fast_equate(&self) -> bool {
529530
false
530531
}
531532

@@ -806,7 +807,8 @@ impl<'tcx> TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
806807
self.param_env
807808
}
808809

809-
fn fast_equate_combine(&self) -> bool {
810+
#[inline]
811+
fn fast_equate(&self) -> bool {
810812
false
811813
}
812814

compiler/rustc_infer/src/infer/equate.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ impl<'tcx> TypeRelation<'tcx> for Equate<'_, '_, 'tcx> {
3232
self.fields.tcx()
3333
}
3434

35-
fn fast_equate_combine(&self) -> bool {
35+
#[inline]
36+
fn fast_equate(&self) -> bool {
3637
true
3738
}
3839

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -2945,7 +2945,8 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
29452945
"SameTypeModuloInfer"
29462946
}
29472947

2948-
fn fast_equate_combine(&self) -> bool {
2948+
#[inline]
2949+
fn fast_equate(&self) -> bool {
29492950
true
29502951
}
29512952

compiler/rustc_infer/src/infer/glb.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ impl<'tcx> TypeRelation<'tcx> for Glb<'_, '_, 'tcx> {
3434
self.fields.tcx()
3535
}
3636

37-
fn fast_equate_combine(&self) -> bool {
37+
#[inline]
38+
fn fast_equate(&self) -> bool {
3839
true
3940
}
4041

compiler/rustc_infer/src/infer/lub.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ impl<'tcx> TypeRelation<'tcx> for Lub<'_, '_, 'tcx> {
3434
self.fields.tcx()
3535
}
3636

37-
fn fast_equate_combine(&self) -> bool {
37+
#[inline]
38+
fn fast_equate(&self) -> bool {
3839
true
3940
}
4041

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ where
535535
self.delegate.param_env()
536536
}
537537

538-
fn fast_equate_combine(&self) -> bool {
538+
#[inline]
539+
fn fast_equate(&self) -> bool {
539540
false
540541
}
541542

@@ -905,7 +906,8 @@ where
905906
self.delegate.param_env()
906907
}
907908

908-
fn fast_equate_combine(&self) -> bool {
909+
#[inline]
910+
fn fast_equate(&self) -> bool {
909911
false
910912
}
911913

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ impl<'tcx> TypeRelation<'tcx> for Match<'tcx> {
142142
fn param_env(&self) -> ty::ParamEnv<'tcx> {
143143
self.param_env
144144
}
145-
fn fast_equate_combine(&self) -> bool {
145+
#[inline]
146+
fn fast_equate(&self) -> bool {
146147
false
147148
}
148149
fn a_is_expected(&self) -> bool {

compiler/rustc_infer/src/infer/sub.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ impl<'tcx> TypeRelation<'tcx> for Sub<'_, '_, 'tcx> {
4343
self.fields.param_env
4444
}
4545

46-
fn fast_equate_combine(&self) -> bool {
46+
#[inline]
47+
fn fast_equate(&self) -> bool {
4748
true
4849
}
4950

compiler/rustc_middle/src/ty/_match.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ impl<'tcx> TypeRelation<'tcx> for Match<'tcx> {
3939
fn param_env(&self) -> ty::ParamEnv<'tcx> {
4040
self.param_env
4141
}
42-
fn fast_equate_combine(&self) -> bool {
42+
#[inline]
43+
fn fast_equate(&self) -> bool {
4344
false
4445
}
4546
fn a_is_expected(&self) -> bool {

compiler/rustc_middle/src/ty/relate.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub trait TypeRelation<'tcx>: Sized {
2929
fn tag(&self) -> &'static str;
3030

3131
/// Returns whether or not structural equality can be used to fast-path this relation
32-
fn fast_equate_combine(&self) -> bool;
32+
fn fast_equate(&self) -> bool;
3333

3434
/// Returns `true` if the value `a` is the "expected" type in the
3535
/// relation. Just affects error messages.
@@ -143,7 +143,7 @@ pub fn relate_substs<'tcx, R: TypeRelation<'tcx>>(
143143
a_subst: SubstsRef<'tcx>,
144144
b_subst: SubstsRef<'tcx>,
145145
) -> RelateResult<'tcx, SubstsRef<'tcx>> {
146-
if relation.fast_equate_combine() && a_subst == b_subst {
146+
if relation.fast_equate() && a_subst == b_subst {
147147
return Ok(a_subst);
148148
}
149149

@@ -159,7 +159,7 @@ pub fn relate_substs_with_variances<'tcx, R: TypeRelation<'tcx>>(
159159
a_subst: SubstsRef<'tcx>,
160160
b_subst: SubstsRef<'tcx>,
161161
) -> RelateResult<'tcx, SubstsRef<'tcx>> {
162-
if relation.fast_equate_combine() && a_subst == b_subst {
162+
if relation.fast_equate() && a_subst == b_subst {
163163
return Ok(a_subst);
164164
}
165165

@@ -365,7 +365,7 @@ impl<'tcx> Relate<'tcx> for GeneratorWitness<'tcx> {
365365
a: GeneratorWitness<'tcx>,
366366
b: GeneratorWitness<'tcx>,
367367
) -> RelateResult<'tcx, GeneratorWitness<'tcx>> {
368-
if relation.fast_equate_combine() && a == b {
368+
if relation.fast_equate() && a == b {
369369
return Ok(a);
370370
}
371371

@@ -670,7 +670,7 @@ impl<'tcx> Relate<'tcx> for &'tcx ty::List<ty::Binder<'tcx, ty::ExistentialPredi
670670
a: Self,
671671
b: Self,
672672
) -> RelateResult<'tcx, Self> {
673-
if relation.fast_equate_combine() && a == b {
673+
if relation.fast_equate() && a == b {
674674
return Ok(a);
675675
}
676676

0 commit comments

Comments
 (0)