@@ -22,7 +22,7 @@ use rustc_span::source_map::Span;
22
22
use rustc_span:: { sym, Symbol } ;
23
23
use rustc_symbol_mangling:: typeid_for_fnabi;
24
24
use rustc_target:: abi:: call:: { ArgAbi , FnAbi , PassMode } ;
25
- use rustc_target:: abi:: { self , HasDataLayout , InitKind , WrappingRange } ;
25
+ use rustc_target:: abi:: { self , HasDataLayout , WrappingRange } ;
26
26
use rustc_target:: spec:: abi:: Abi ;
27
27
28
28
/// Used by `FunctionCx::codegen_terminator` for emitting common patterns
@@ -528,7 +528,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
528
528
source_info : mir:: SourceInfo ,
529
529
target : Option < mir:: BasicBlock > ,
530
530
cleanup : Option < mir:: BasicBlock > ,
531
- strict_validity : bool ,
532
531
) -> bool {
533
532
// Emit a panic or a no-op for `assert_*` intrinsics.
534
533
// These are intrinsics that compile to panics so that we can get a message
@@ -547,12 +546,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
547
546
} ) ;
548
547
if let Some ( intrinsic) = panic_intrinsic {
549
548
use AssertIntrinsic :: * ;
549
+
550
550
let ty = instance. unwrap ( ) . substs . type_at ( 0 ) ;
551
551
let layout = bx. layout_of ( ty) ;
552
552
let do_panic = match intrinsic {
553
553
Inhabited => layout. abi . is_uninhabited ( ) ,
554
- ZeroValid => !layout . might_permit_raw_init ( bx , InitKind :: Zero , strict_validity ) ,
555
- UninitValid => !layout . might_permit_raw_init ( bx , InitKind :: Uninit , strict_validity ) ,
554
+ ZeroValid => !bx . tcx ( ) . permits_zero_init ( layout ) ,
555
+ UninitValid => !bx . tcx ( ) . permits_uninit_init ( layout ) ,
556
556
} ;
557
557
if do_panic {
558
558
let msg_str = with_no_visible_paths ! ( {
@@ -687,7 +687,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
687
687
source_info,
688
688
target,
689
689
cleanup,
690
- self . cx . tcx ( ) . sess . opts . unstable_opts . strict_init_checks ,
691
690
) {
692
691
return ;
693
692
}
0 commit comments