@@ -263,11 +263,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
263
263
// elision. `resolve_lifetime` should have
264
264
// reported an error in this case -- but if
265
265
// 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" )
271
267
} )
272
268
}
273
269
}
@@ -481,11 +477,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
481
477
debug ! ( ?param, "unelided lifetime in signature" ) ;
482
478
483
479
// 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" )
489
481
} )
490
482
. into ( ) ,
491
483
GenericParamDefKind :: Type { has_default, .. } => {
@@ -1622,14 +1614,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1622
1614
"the lifetime bound for this object type cannot be deduced \
1623
1615
from context; please supply an explicit bound"
1624
1616
) ;
1625
- if borrowed {
1617
+ let e = if borrowed {
1626
1618
// We will have already emitted an error E0106 complaining about a
1627
1619
// missing named lifetime in `&dyn Trait`, so we elide this one.
1628
- err. delay_as_bug ( ) ;
1620
+ err. delay_as_bug ( )
1629
1621
} else {
1630
- err. emit ( ) ;
1631
- }
1632
- tcx. lifetimes . re_static
1622
+ err. emit ( )
1623
+ } ;
1624
+ tcx. re_error ( e )
1633
1625
} )
1634
1626
}
1635
1627
} )
0 commit comments