@@ -2279,6 +2279,7 @@ impl<'tcx> TyCtxt<'tcx> {
2279
2279
2280
2280
/// Returns `true` if the impls are the same polarity and the trait either
2281
2281
/// has no items or is annotated `#[marker]` and prevents item overrides.
2282
+ #[ instrument( level = "debug" , skip( self ) , ret) ]
2282
2283
pub fn impls_are_allowed_to_overlap (
2283
2284
self ,
2284
2285
def_id1 : DefId ,
@@ -2297,19 +2298,11 @@ impl<'tcx> TyCtxt<'tcx> {
2297
2298
match ( self . impl_polarity ( def_id1) , self . impl_polarity ( def_id2) ) {
2298
2299
( ImplPolarity :: Reservation , _) | ( _, ImplPolarity :: Reservation ) => {
2299
2300
// `#[rustc_reservation_impl]` impls don't overlap with anything
2300
- debug ! (
2301
- "impls_are_allowed_to_overlap({:?}, {:?}) = Some(Permitted) (reservations)" ,
2302
- def_id1, def_id2
2303
- ) ;
2304
2301
return Some ( ImplOverlapKind :: Permitted { marker : false } ) ;
2305
2302
}
2306
2303
( ImplPolarity :: Positive , ImplPolarity :: Negative )
2307
2304
| ( ImplPolarity :: Negative , ImplPolarity :: Positive ) => {
2308
2305
// `impl AutoTrait for Type` + `impl !AutoTrait for Type`
2309
- debug ! (
2310
- "impls_are_allowed_to_overlap({:?}, {:?}) - None (differing polarities)" ,
2311
- def_id1, def_id2
2312
- ) ;
2313
2306
return None ;
2314
2307
}
2315
2308
( ImplPolarity :: Positive , ImplPolarity :: Positive )
@@ -2324,30 +2317,18 @@ impl<'tcx> TyCtxt<'tcx> {
2324
2317
} ;
2325
2318
2326
2319
if is_marker_overlap {
2327
- debug ! (
2328
- "impls_are_allowed_to_overlap({:?}, {:?}) = Some(Permitted) (marker overlap)" ,
2329
- def_id1, def_id2
2330
- ) ;
2331
2320
Some ( ImplOverlapKind :: Permitted { marker : true } )
2332
2321
} else {
2333
2322
if let Some ( self_ty1) = self . issue33140_self_ty ( def_id1) {
2334
2323
if let Some ( self_ty2) = self . issue33140_self_ty ( def_id2) {
2335
2324
if self_ty1 == self_ty2 {
2336
- debug ! (
2337
- "impls_are_allowed_to_overlap({:?}, {:?}) - issue #33140 HACK" ,
2338
- def_id1, def_id2
2339
- ) ;
2340
2325
return Some ( ImplOverlapKind :: Issue33140 ) ;
2341
2326
} else {
2342
- debug ! (
2343
- "impls_are_allowed_to_overlap({:?}, {:?}) - found {:?} != {:?}" ,
2344
- def_id1, def_id2, self_ty1, self_ty2
2345
- ) ;
2327
+ debug ! ( "found {self_ty1:?} != {self_ty2:?}" ) ;
2346
2328
}
2347
2329
}
2348
2330
}
2349
2331
2350
- debug ! ( "impls_are_allowed_to_overlap({:?}, {:?}) = None" , def_id1, def_id2) ;
2351
2332
None
2352
2333
}
2353
2334
}
0 commit comments