@@ -44,7 +44,7 @@ pub fn extract_verify_if_eq<'tcx>(
44
44
test_ty : Ty < ' tcx > ,
45
45
) -> Option < ty:: Region < ' tcx > > {
46
46
assert ! ( !verify_if_eq_b. has_escaping_bound_vars( ) ) ;
47
- let mut m = Match :: new ( tcx, param_env) ;
47
+ let mut m = MatchAgainstHigherRankedOutlives :: new ( tcx, param_env) ;
48
48
let verify_if_eq = verify_if_eq_b. skip_binder ( ) ;
49
49
m. relate ( verify_if_eq. ty , test_ty) . ok ( ) ?;
50
50
@@ -87,24 +87,32 @@ pub(super) fn can_match_erased_ty<'tcx>(
87
87
// pointless micro-optimization
88
88
true
89
89
} else {
90
- Match :: new ( tcx, param_env) . relate ( outlives_ty, erased_ty) . is_ok ( )
90
+ MatchAgainstHigherRankedOutlives :: new ( tcx, param_env) . relate ( outlives_ty, erased_ty) . is_ok ( )
91
91
}
92
92
}
93
93
94
- struct Match < ' tcx > {
94
+ struct MatchAgainstHigherRankedOutlives < ' tcx > {
95
95
tcx : TyCtxt < ' tcx > ,
96
96
param_env : ty:: ParamEnv < ' tcx > ,
97
97
pattern_depth : ty:: DebruijnIndex ,
98
98
map : FxHashMap < ty:: BoundRegion , ty:: Region < ' tcx > > ,
99
99
}
100
100
101
- impl < ' tcx > Match < ' tcx > {
102
- fn new ( tcx : TyCtxt < ' tcx > , param_env : ty:: ParamEnv < ' tcx > ) -> Match < ' tcx > {
103
- Match { tcx, param_env, pattern_depth : ty:: INNERMOST , map : FxHashMap :: default ( ) }
101
+ impl < ' tcx > MatchAgainstHigherRankedOutlives < ' tcx > {
102
+ fn new (
103
+ tcx : TyCtxt < ' tcx > ,
104
+ param_env : ty:: ParamEnv < ' tcx > ,
105
+ ) -> MatchAgainstHigherRankedOutlives < ' tcx > {
106
+ MatchAgainstHigherRankedOutlives {
107
+ tcx,
108
+ param_env,
109
+ pattern_depth : ty:: INNERMOST ,
110
+ map : FxHashMap :: default ( ) ,
111
+ }
104
112
}
105
113
}
106
114
107
- impl < ' tcx > Match < ' tcx > {
115
+ impl < ' tcx > MatchAgainstHigherRankedOutlives < ' tcx > {
108
116
/// Creates the "Error" variant that signals "no match".
109
117
fn no_match < T > ( & self ) -> RelateResult < ' tcx , T > {
110
118
Err ( TypeError :: Mismatch )
@@ -134,7 +142,7 @@ impl<'tcx> Match<'tcx> {
134
142
}
135
143
}
136
144
137
- impl < ' tcx > TypeRelation < ' tcx > for Match < ' tcx > {
145
+ impl < ' tcx > TypeRelation < ' tcx > for MatchAgainstHigherRankedOutlives < ' tcx > {
138
146
fn tag ( & self ) -> & ' static str {
139
147
"Match"
140
148
}
0 commit comments