This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -1590,13 +1590,11 @@ impl<'tcx> TyCtxt<'tcx> {
15901590 def_id1 : DefId ,
15911591 def_id2 : DefId ,
15921592 ) -> Option < ImplOverlapKind > {
1593- let impl_trait_ref1 = self . impl_trait_ref ( def_id1) . unwrap ( ) ;
1594- let impl_trait_ref2 = self . impl_trait_ref ( def_id2) . unwrap ( ) ;
1593+ let impl_trait_ref1 = self . impl_trait_ref ( def_id1) . unwrap ( ) . instantiate_identity ( ) ;
1594+ let impl_trait_ref2 = self . impl_trait_ref ( def_id2) . unwrap ( ) . instantiate_identity ( ) ;
15951595 // If either trait impl references an error, they're allowed to overlap,
15961596 // as one of them essentially doesn't exist.
1597- if impl_trait_ref1. instantiate_identity ( ) . references_error ( )
1598- || impl_trait_ref2. instantiate_identity ( ) . references_error ( )
1599- {
1597+ if impl_trait_ref1. references_error ( ) || impl_trait_ref2. references_error ( ) {
16001598 return Some ( ImplOverlapKind :: Permitted { marker : false } ) ;
16011599 }
16021600
@@ -1615,9 +1613,8 @@ impl<'tcx> TyCtxt<'tcx> {
16151613 } ;
16161614
16171615 let is_marker_overlap = {
1618- let is_marker_impl = |trait_ref : EarlyBinder < TraitRef < ' _ > > | -> bool {
1619- self . trait_def ( trait_ref. skip_binder ( ) . def_id ) . is_marker
1620- } ;
1616+ let is_marker_impl =
1617+ |trait_ref : TraitRef < ' _ > | -> bool { self . trait_def ( trait_ref. def_id ) . is_marker } ;
16211618 is_marker_impl ( impl_trait_ref1) && is_marker_impl ( impl_trait_ref2)
16221619 } ;
16231620
You can’t perform that action at this time.
0 commit comments