X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_codegen_ssa%2Fsrc%2Fmir%2Fblock.rs;h=2a76ad0fb1356ebb1b244e19ba413444a1fcb6b5;hb=8e6d126b7d69281072f16dcc3cfff140e8947c58;hp=673d348a2a89c377b3af1602e44cc1156579f775;hpb=517c28e421b0d601c6f8eb07ea6aafb8e16975ad;p=rust.git diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index 673d348a2a8..2a76ad0fb13 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -472,10 +472,8 @@ enum AssertIntrinsic { let layout = bx.layout_of(ty); let do_panic = match intrinsic { Inhabited => layout.abi.is_uninhabited(), - // We unwrap as the error type is `!`. - ZeroValid => !layout.might_permit_raw_init(bx, /*zero:*/ true).unwrap(), - // We unwrap as the error type is `!`. - UninitValid => !layout.might_permit_raw_init(bx, /*zero:*/ false).unwrap(), + ZeroValid => !layout.might_permit_raw_init(bx, /*zero:*/ true), + UninitValid => !layout.might_permit_raw_init(bx, /*zero:*/ false), }; if do_panic { let msg_str = with_no_trimmed_paths(|| {