@@ -263,11 +263,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
263263 // elision. `resolve_lifetime` should have
264264 // reported an error in this case -- but if
265265 // not, let's error out.
266- tcx. sess . delay_span_bug ( lifetime. ident . span , "unelided lifetime in signature" ) ;
267-
268- // Supply some dummy value. We don't have an
269- // `re_error`, annoyingly, so use `'static`.
270- tcx. lifetimes . re_static
266+ tcx. re_error_with_message ( lifetime. ident . span , "unelided lifetime in signature" )
271267 } )
272268 }
273269 }
@@ -481,11 +477,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
481477 debug ! ( ?param, "unelided lifetime in signature" ) ;
482478
483479 // This indicates an illegal lifetime in a non-assoc-trait position
484- tcx. sess . delay_span_bug ( self . span , "unelided lifetime in signature" ) ;
485-
486- // Supply some dummy value. We don't have an
487- // `re_error`, annoyingly, so use `'static`.
488- tcx. lifetimes . re_static
480+ tcx. re_error_with_message ( self . span , "unelided lifetime in signature" )
489481 } )
490482 . into ( ) ,
491483 GenericParamDefKind :: Type { has_default, .. } => {
@@ -1622,14 +1614,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
16221614 "the lifetime bound for this object type cannot be deduced \
16231615 from context; please supply an explicit bound"
16241616 ) ;
1625- if borrowed {
1617+ let e = if borrowed {
16261618 // We will have already emitted an error E0106 complaining about a
16271619 // missing named lifetime in `&dyn Trait`, so we elide this one.
1628- err. delay_as_bug ( ) ;
1620+ err. delay_as_bug ( )
16291621 } else {
1630- err. emit ( ) ;
1631- }
1632- tcx. lifetimes . re_static
1622+ err. emit ( )
1623+ } ;
1624+ tcx. re_error ( e )
16331625 } )
16341626 }
16351627 } )
0 commit comments