@@ -18,7 +18,6 @@ use rustc_target::abi::{call::FnAbi, HasDataLayout, PointeeInfo, Size, TargetDat
18
18
use rustc_target:: spec:: { HasTargetSpec , Target , TlsModel } ;
19
19
20
20
use crate :: callee:: get_fn;
21
- use crate :: errors:: LayoutSizeOverflow ;
22
21
23
22
#[ derive( Clone ) ]
24
23
pub struct FuncSig < ' gcc > {
@@ -294,7 +293,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
294
293
self . is_native_int_type ( typ) || self . is_non_native_int_type ( typ) || typ. is_compatible_with ( self . bool_type )
295
294
}
296
295
297
- pub fn sess ( & self ) -> & Session {
296
+ pub fn sess ( & self ) -> & ' tcx Session {
298
297
& self . tcx . sess
299
298
}
300
299
@@ -478,24 +477,7 @@ impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
478
477
#[ inline]
479
478
fn handle_layout_err ( & self , err : LayoutError < ' tcx > , span : Span , ty : Ty < ' tcx > ) -> ! {
480
479
if let LayoutError :: SizeOverflow ( _) = err {
481
- let _ = respan ( span, err) ;
482
- // error: lifetime may not live long enough
483
- // --> src/context.rs:483:13
484
- // |
485
- // 475 | impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
486
- // | ---- ---- lifetime `'tcx` defined here
487
- // | |
488
- // | lifetime `'gcc` defined here
489
- // ...
490
- // 483 | self.sess().emit_fatal(respan(span, err))
491
- // | ^^^^^^^^^^^ argument requires that `'gcc` must outlive `'tcx`
492
- // |
493
- // = help: consider adding the following bound: `'gcc: 'tcx`
494
- // = note: requirement occurs because of the type `CodegenCx<'_, '_>`, which makes the generic argument `'_` invariant
495
- // = note: the struct `CodegenCx<'gcc, 'tcx>` is invariant over the parameter `'gcc`
496
- // = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
497
- // self.sess().emit_fatal(respan(span, err))
498
- self . sess ( ) . emit_fatal ( LayoutSizeOverflow { span, error : err. to_string ( ) } )
480
+ self . sess ( ) . emit_fatal ( respan ( span, err) )
499
481
} else {
500
482
span_bug ! ( span, "failed to get layout for `{}`: {}" , ty, err)
501
483
}
@@ -513,7 +495,7 @@ impl<'gcc, 'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
513
495
fn_abi_request : FnAbiRequest < ' tcx > ,
514
496
) -> ! {
515
497
if let FnAbiError :: Layout ( LayoutError :: SizeOverflow ( _) ) = err {
516
- self . sess ( ) . emit_fatal ( LayoutSizeOverflow { span, error : err. to_string ( ) } )
498
+ self . sess ( ) . emit_fatal ( respan ( span, err) )
517
499
} else {
518
500
match fn_abi_request {
519
501
FnAbiRequest :: OfFnPtr { sig, extra_args } => {
0 commit comments