File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -658,12 +658,15 @@ impl<'tcx> ScopeTree {
658658 // The lifetime was defined on node that doesn't own a body,
659659 // which in practice can only mean a trait or an impl, that
660660 // is the parent of a method, and that is enforced below.
661- assert_eq ! ( Some ( param_owner_id) , self . root_parent,
662- "free_scope: {:?} not recognized by the \
663- region scope tree for {:?} / {:?}",
664- param_owner,
665- self . root_parent. map( |id| tcx. hir( ) . local_def_id_from_hir_id( id) ) ,
666- self . root_body. map( |hir_id| DefId :: local( hir_id. owner) ) ) ;
661+ if Some ( param_owner_id) != self . root_parent {
662+ tcx. sess . delay_span_bug (
663+ DUMMY_SP ,
664+ & format ! ( "free_scope: {:?} not recognized by the \
665+ region scope tree for {:?} / {:?}",
666+ param_owner,
667+ self . root_parent. map( |id| tcx. hir( ) . local_def_id_from_hir_id( id) ) ,
668+ self . root_body. map( |hir_id| DefId :: local( hir_id. owner) ) ) ) ;
669+ }
667670
668671 // The trait/impl lifetime is in scope for the method's body.
669672 self . root_body . unwrap ( ) . local_id
You can’t perform that action at this time.
0 commit comments