@@ -140,21 +140,21 @@ fn with_fresh_ty_vars<'cx, 'tcx>(
140
140
fn overlap < ' cx , ' tcx > (
141
141
selcx : & mut SelectionContext < ' cx , ' tcx > ,
142
142
skip_leak_check : SkipLeakCheck ,
143
- a_def_id : DefId ,
144
- b_def_id : DefId ,
143
+ impl1_def_id : DefId ,
144
+ impl2_def_id : DefId ,
145
145
) -> Option < OverlapResult < ' tcx > > {
146
- debug ! ( "overlap(a_def_id ={:?}, b_def_id ={:?})" , a_def_id , b_def_id ) ;
146
+ debug ! ( "overlap(impl1_def_id ={:?}, impl2_def_id ={:?})" , impl1_def_id , impl2_def_id ) ;
147
147
148
148
selcx. infcx ( ) . probe_maybe_skip_leak_check ( skip_leak_check. is_yes ( ) , |snapshot| {
149
- overlap_within_probe ( selcx, skip_leak_check, a_def_id , b_def_id , snapshot)
149
+ overlap_within_probe ( selcx, skip_leak_check, impl1_def_id , impl2_def_id , snapshot)
150
150
} )
151
151
}
152
152
153
153
fn overlap_within_probe < ' cx , ' tcx > (
154
154
selcx : & mut SelectionContext < ' cx , ' tcx > ,
155
155
skip_leak_check : SkipLeakCheck ,
156
- a_def_id : DefId ,
157
- b_def_id : DefId ,
156
+ impl1_def_id : DefId ,
157
+ impl2_def_id : DefId ,
158
158
snapshot : & CombinedSnapshot < ' _ , ' tcx > ,
159
159
) -> Option < OverlapResult < ' tcx > > {
160
160
fn loose_check < ' cx , ' tcx > (
@@ -182,17 +182,17 @@ fn overlap_within_probe<'cx, 'tcx>(
182
182
// empty environment.
183
183
let param_env = ty:: ParamEnv :: empty ( ) ;
184
184
185
- let a_impl_header = with_fresh_ty_vars ( selcx, param_env, a_def_id ) ;
186
- let b_impl_header = with_fresh_ty_vars ( selcx, param_env, b_def_id ) ;
185
+ let impl1_header = with_fresh_ty_vars ( selcx, param_env, impl1_def_id ) ;
186
+ let impl2_header = with_fresh_ty_vars ( selcx, param_env, impl2_def_id ) ;
187
187
188
- debug ! ( "overlap: a_impl_header ={:?}" , a_impl_header ) ;
189
- debug ! ( "overlap: b_impl_header ={:?}" , b_impl_header ) ;
188
+ debug ! ( "overlap: impl1_header ={:?}" , impl1_header ) ;
189
+ debug ! ( "overlap: impl2_header ={:?}" , impl2_header ) ;
190
190
191
191
// Do `a` and `b` unify? If not, no overlap.
192
192
let obligations = match selcx
193
193
. infcx ( )
194
194
. at ( & ObligationCause :: dummy ( ) , param_env)
195
- . eq_impl_headers ( & a_impl_header , & b_impl_header )
195
+ . eq_impl_headers ( & impl1_header , & impl2_header )
196
196
{
197
197
Ok ( InferOk { obligations, value : ( ) } ) => obligations,
198
198
Err ( _) => {
@@ -225,11 +225,11 @@ fn overlap_within_probe<'cx, 'tcx>(
225
225
// at some point an impl for `&'?a str: Error` could be added.
226
226
let infcx = selcx. infcx ( ) ;
227
227
let tcx = infcx. tcx ;
228
- let opt_failing_obligation = a_impl_header
228
+ let opt_failing_obligation = impl1_header
229
229
. predicates
230
230
. iter ( )
231
231
. copied ( )
232
- . chain ( b_impl_header . predicates )
232
+ . chain ( impl2_header . predicates )
233
233
. map ( |p| infcx. resolve_vars_if_possible ( p) )
234
234
. map ( |p| Obligation {
235
235
cause : ObligationCause :: dummy ( ) ,
@@ -241,8 +241,8 @@ fn overlap_within_probe<'cx, 'tcx>(
241
241
. find ( |o| {
242
242
// if both impl headers are set to strict coherence it means that this will be accepted
243
243
// only if it's stated that T: !Trait. So only prove that the negated obligation holds.
244
- if tcx. has_attr ( a_def_id , sym:: rustc_strict_coherence)
245
- && tcx. has_attr ( b_def_id , sym:: rustc_strict_coherence)
244
+ if tcx. has_attr ( impl1_def_id , sym:: rustc_strict_coherence)
245
+ && tcx. has_attr ( impl2_def_id , sym:: rustc_strict_coherence)
246
246
{
247
247
strict_check ( selcx, o)
248
248
} else {
@@ -265,7 +265,7 @@ fn overlap_within_probe<'cx, 'tcx>(
265
265
}
266
266
}
267
267
268
- let impl_header = selcx. infcx ( ) . resolve_vars_if_possible ( a_impl_header ) ;
268
+ let impl_header = selcx. infcx ( ) . resolve_vars_if_possible ( impl1_header ) ;
269
269
let intercrate_ambiguity_causes = selcx. take_intercrate_ambiguity_causes ( ) ;
270
270
debug ! ( "overlap: intercrate_ambiguity_causes={:#?}" , intercrate_ambiguity_causes) ;
271
271
0 commit comments