diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index 4cee77fda4fba..374f01fa28f44 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -2647,6 +2647,7 @@ pub const unsafe fn const_make_global(ptr: *mut u8) -> *const u8 { // doesn't honor `#[allow_internal_unstable]`, so for the const feature gate we use the user-facing // `contracts` feature rather than the perma-unstable `contracts_internals` #[rustc_const_unstable(feature = "contracts", issue = "128044")] +#[miri::intrinsic_fallback_is_spec] #[lang = "contract_check_requires"] #[rustc_intrinsic] pub const fn contract_check_requires bool + Copy>(cond: C) { @@ -2676,6 +2677,7 @@ pub const fn contract_check_requires bool + Copy>(cond: C) { // `contracts` feature rather than the perma-unstable `contracts_internals`. // Const-checking doesn't honor allow_internal_unstable logic used by contract expansion. #[rustc_const_unstable(feature = "contracts", issue = "128044")] +#[miri::intrinsic_fallback_is_spec] #[lang = "contract_check_ensures"] #[rustc_intrinsic] pub const fn contract_check_ensures bool + Copy, Ret>( diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index e213e1d91a75d..260b846872842 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -107,6 +107,7 @@ #![feature(const_destruct)] #![feature(const_eval_select)] #![feature(const_select_unpredictable)] +#![feature(contracts)] #![feature(core_intrinsics)] #![feature(coverage_attribute)] #![feature(disjoint_bitor)] diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 619e8a263db40..a84e5c6aa5495 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -507,6 +507,8 @@ pub const fn align_of() -> usize { #[must_use] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_align_of_val", since = "1.85.0")] +#[rustc_allow_const_fn_unstable(contracts)] +#[core::contracts::ensures(|result: &usize| result.is_power_of_two())] pub const fn align_of_val(val: &T) -> usize { // SAFETY: val is a reference, so it's a valid raw pointer unsafe { intrinsics::align_of_val(val) } diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs index bc7d3a1de7151..1c66ff0feb62d 100644 --- a/library/core/src/ptr/alignment.rs +++ b/library/core/src/ptr/alignment.rs @@ -45,6 +45,8 @@ impl Alignment { #[unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] #[must_use] + #[rustc_allow_const_fn_unstable(contracts)] + #[core::contracts::ensures(|result: &Alignment| result.as_usize().is_power_of_two())] pub const fn of() -> Self { // This can't actually panic since type alignment is always a power of two. const { Alignment::new(align_of::()).unwrap() } @@ -56,6 +58,11 @@ impl Alignment { /// Note that `0` is not a power of two, nor a valid alignment. #[unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] + #[rustc_allow_const_fn_unstable(contracts)] + #[core::contracts::ensures( + move |result: &Option| + align.is_power_of_two() == result.is_some() && + (result.is_none() || result.unwrap().as_usize() == align))] pub const fn new(align: usize) -> Option { if align.is_power_of_two() { // SAFETY: Just checked it only has one bit set @@ -76,6 +83,11 @@ impl Alignment { #[unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] #[track_caller] + #[rustc_allow_const_fn_unstable(contracts)] + #[core::contracts::requires(align.is_power_of_two())] + #[core::contracts::ensures( + move |result: &Alignment| + result.as_usize() == align && result.as_usize().is_power_of_two())] pub const unsafe fn new_unchecked(align: usize) -> Self { assert_unsafe_precondition!( check_language_ub, @@ -91,6 +103,8 @@ impl Alignment { /// Returns the alignment as a [`usize`]. #[unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] + #[rustc_allow_const_fn_unstable(contracts)] + #[core::contracts::ensures(|result: &usize| result.is_power_of_two())] pub const fn as_usize(self) -> usize { self.0 as usize } @@ -98,6 +112,10 @@ impl Alignment { /// Returns the alignment as a [NonZero]<[usize]>. #[unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] + #[rustc_allow_const_fn_unstable(contracts)] + #[core::contracts::ensures( + move |result: &NonZero| + result.get().is_power_of_two() && result.get() == self.as_usize())] pub const fn as_nonzero(self) -> NonZero { // This transmutes directly to avoid the UbCheck in `NonZero::new_unchecked` // since there's no way for the user to trip that check anyway -- the @@ -123,6 +141,11 @@ impl Alignment { /// ``` #[unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] + #[rustc_const_unstable(feature = "contracts", issue = "128044")] + #[core::contracts::requires(self.as_usize().is_power_of_two())] + #[core::contracts::ensures( + move |result: &u32| + *result < usize::BITS && (1usize << *result) == self.as_usize())] pub const fn log2(self) -> u32 { self.as_nonzero().trailing_zeros() } @@ -152,6 +175,11 @@ impl Alignment { /// ``` #[unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] + #[rustc_const_unstable(feature = "contracts", issue = "128044")] + #[core::contracts::ensures( + move |result: &usize| + *result > 0 && *result == !(self.as_usize() -1) && + self.as_usize() & *result == self.as_usize())] pub const fn mask(self) -> usize { // SAFETY: The alignment is always nonzero, and therefore decrementing won't overflow. !(unsafe { self.as_usize().unchecked_sub(1) }) diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff index 2c89670dcf7d7..b8dce7181a8e5 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff index 8fecfe224cc69..dce227bbdcca6 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff index 976ea252c2f89..9dc416bd2012d 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff index 6c59f5e3e2e86..5b6a94a615047 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff index 1f9cf6d6aca83..a9962926fb4e0 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff index a8760285fac11..2b0ee1fdb6dae 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff index c398ae70a1a3e..ed36d7445edcf 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff index 02934c02587d2..da586389d0faf 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff @@ -18,21 +18,37 @@ scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let mut _6: std::num::NonZero; scope 6 { - scope 8 (inlined std::ptr::Alignment::as_nonzero) { + scope 12 (inlined std::ptr::Alignment::as_nonzero) { + scope 13 { + scope 14 { + scope 15 { + } + } + } + scope 16 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) { + scope 17 (inlined NonNull::<[bool; 0]>::without_provenance) { let _7: *const [bool; 0]; - scope 10 { + scope 18 { } - scope 11 (inlined NonZero::::get) { + scope 19 (inlined NonZero::::get) { } - scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) { - scope 13 (inlined without_provenance_mut::<[bool; 0]>) { + scope 20 (inlined std::ptr::without_provenance::<[bool; 0]>) { + scope 21 (inlined without_provenance_mut::<[bool; 0]>) { } } } } scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) { + scope 8 { + scope 9 { + scope 10 { + } + } + } + scope 11 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } } diff --git a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff index f56af33ea603f..d546e679d8a3b 100644 --- a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff +++ b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff @@ -9,30 +9,46 @@ scope 2 (inlined NonNull::::dangling) { let mut _3: std::num::NonZero; scope 3 { - scope 5 (inlined std::ptr::Alignment::as_nonzero) { + scope 9 (inlined std::ptr::Alignment::as_nonzero) { + scope 10 { + scope 11 { + scope 12 { + } + } + } + scope 13 (inlined core::contracts::build_check_ensures::, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) { + } } - scope 6 (inlined NonNull::::without_provenance) { - scope 7 { + scope 14 (inlined NonNull::::without_provenance) { + scope 15 { } - scope 8 (inlined NonZero::::get) { + scope 16 (inlined NonZero::::get) { } - scope 9 (inlined std::ptr::without_provenance::) { - scope 10 (inlined without_provenance_mut::) { + scope 17 (inlined std::ptr::without_provenance::) { + scope 18 (inlined without_provenance_mut::) { } } } } scope 4 (inlined std::ptr::Alignment::of::) { + scope 5 { + scope 6 { + scope 7 { + } + } + } + scope 8 (inlined core::contracts::build_check_ensures::::{closure#0}}>) { + } } } - scope 11 (inlined NonNull::::as_ptr) { + scope 19 (inlined NonNull::::as_ptr) { } } - scope 12 (inlined Foo::::cmp_ptr) { + scope 20 (inlined Foo::::cmp_ptr) { let mut _4: *const u8; let mut _5: *mut u8; let mut _6: *const u8; - scope 13 (inlined std::ptr::eq::) { + scope 21 (inlined std::ptr::eq::) { } } diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir index 791d6b71a6f78..053545848c392 100644 --- a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-abort.mir @@ -36,6 +36,14 @@ fn generic_in_place(_1: *mut Box<[T]>) -> () { } scope 23 (inlined Layout::align) { scope 24 (inlined std::ptr::Alignment::as_usize) { + scope 25 { + scope 26 { + scope 27 { + } + } + } + scope 28 (inlined core::contracts::build_check_ensures::) { + } } } } diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir index 791d6b71a6f78..053545848c392 100644 --- a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.32bit.panic-unwind.mir @@ -36,6 +36,14 @@ fn generic_in_place(_1: *mut Box<[T]>) -> () { } scope 23 (inlined Layout::align) { scope 24 (inlined std::ptr::Alignment::as_usize) { + scope 25 { + scope 26 { + scope 27 { + } + } + } + scope 28 (inlined core::contracts::build_check_ensures::) { + } } } } diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-abort.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-abort.mir index 791d6b71a6f78..053545848c392 100644 --- a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-abort.mir @@ -36,6 +36,14 @@ fn generic_in_place(_1: *mut Box<[T]>) -> () { } scope 23 (inlined Layout::align) { scope 24 (inlined std::ptr::Alignment::as_usize) { + scope 25 { + scope 26 { + scope 27 { + } + } + } + scope 28 (inlined core::contracts::build_check_ensures::) { + } } } } diff --git a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir index 791d6b71a6f78..053545848c392 100644 --- a/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/drop_boxed_slice.generic_in_place.PreCodegen.after.64bit.panic-unwind.mir @@ -36,6 +36,14 @@ fn generic_in_place(_1: *mut Box<[T]>) -> () { } scope 23 (inlined Layout::align) { scope 24 (inlined std::ptr::Alignment::as_usize) { + scope 25 { + scope 26 { + scope 27 { + } + } + } + scope 28 (inlined core::contracts::build_check_ensures::) { + } } } }