@@ -19,7 +19,6 @@ use rustc_target::abi::{call::FnAbi, HasDataLayout, PointeeInfo, Size, TargetDat
19
19
use rustc_target:: spec:: { HasTargetSpec , Target , TlsModel } ;
20
20
21
21
use crate :: callee:: get_fn;
22
- use crate :: errors:: LayoutSizeOverflow ;
23
22
24
23
#[ derive( Clone ) ]
25
24
pub struct FuncSig < ' gcc > {
@@ -299,7 +298,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
299
298
self . is_native_int_type ( typ) || self . is_non_native_int_type ( typ) || typ. is_compatible_with ( self . bool_type )
300
299
}
301
300
302
- pub fn sess ( & self ) -> & Session {
301
+ pub fn sess ( & self ) -> & ' tcx Session {
303
302
& self . tcx . sess
304
303
}
305
304
@@ -493,24 +492,7 @@ impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
493
492
#[ inline]
494
493
fn handle_layout_err ( & self , err : LayoutError < ' tcx > , span : Span , ty : Ty < ' tcx > ) -> ! {
495
494
if let LayoutError :: SizeOverflow ( _) = err {
496
- let _ = respan ( span, err) ;
497
- // error: lifetime may not live long enough
498
- // --> src/context.rs:483:13
499
- // |
500
- // 475 | impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
501
- // | ---- ---- lifetime `'tcx` defined here
502
- // | |
503
- // | lifetime `'gcc` defined here
504
- // ...
505
- // 483 | self.sess().emit_fatal(respan(span, err))
506
- // | ^^^^^^^^^^^ argument requires that `'gcc` must outlive `'tcx`
507
- // |
508
- // = help: consider adding the following bound: `'gcc: 'tcx`
509
- // = note: requirement occurs because of the type `CodegenCx<'_, '_>`, which makes the generic argument `'_` invariant
510
- // = note: the struct `CodegenCx<'gcc, 'tcx>` is invariant over the parameter `'gcc`
511
- // = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
512
- // self.sess().emit_fatal(respan(span, err))
513
- self . sess ( ) . emit_fatal ( LayoutSizeOverflow { span, error : err. to_string ( ) } )
495
+ self . sess ( ) . emit_fatal ( respan ( span, err) )
514
496
} else {
515
497
span_bug ! ( span, "failed to get layout for `{}`: {}" , ty, err)
516
498
}
@@ -528,7 +510,7 @@ impl<'gcc, 'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
528
510
fn_abi_request : FnAbiRequest < ' tcx > ,
529
511
) -> ! {
530
512
if let FnAbiError :: Layout ( LayoutError :: SizeOverflow ( _) ) = err {
531
- self . sess ( ) . emit_fatal ( LayoutSizeOverflow { span, error : err. to_string ( ) } )
513
+ self . sess ( ) . emit_fatal ( respan ( span, err) )
532
514
} else {
533
515
match fn_abi_request {
534
516
FnAbiRequest :: OfFnPtr { sig, extra_args } => {
0 commit comments