@@ -3870,16 +3870,10 @@ impl<T> [T] {
38703870 let ( us_len, ts_len) = rest. align_to_offsets :: < U > ( ) ;
38713871 // Inform Miri that we want to consider the "middle" pointer to be suitably aligned.
38723872 #[ cfg( miri) ]
3873- {
3874- extern "Rust" {
3875- pub fn miri_promise_symbolic_alignment ( ptr : * const ( ) , align : usize ) ;
3876- }
3877-
3878- // SAFETY: this call is always safe.
3879- unsafe {
3880- miri_promise_symbolic_alignment ( rest. as_ptr ( ) . cast ( ) , mem:: align_of :: < U > ( ) ) ;
3881- }
3882- }
3873+ crate :: intrinsics:: miri_promise_symbolic_alignment (
3874+ rest. as_ptr ( ) . cast ( ) ,
3875+ mem:: align_of :: < U > ( ) ,
3876+ ) ;
38833877 // SAFETY: now `rest` is definitely aligned, so `from_raw_parts` below is okay,
38843878 // since the caller guarantees that we can transmute `T` to `U` safely.
38853879 unsafe {
@@ -3952,19 +3946,10 @@ impl<T> [T] {
39523946 let mut_ptr = rest. as_mut_ptr ( ) ;
39533947 // Inform Miri that we want to consider the "middle" pointer to be suitably aligned.
39543948 #[ cfg( miri) ]
3955- {
3956- extern "Rust" {
3957- pub fn miri_promise_symbolic_alignment ( ptr : * const ( ) , align : usize ) ;
3958- }
3959-
3960- // SAFETY: this call is always safe.
3961- unsafe {
3962- miri_promise_symbolic_alignment (
3963- mut_ptr. cast ( ) as * const ( ) ,
3964- mem:: align_of :: < U > ( ) ,
3965- ) ;
3966- }
3967- }
3949+ crate :: intrinsics:: miri_promise_symbolic_alignment (
3950+ mut_ptr. cast ( ) as * const ( ) ,
3951+ mem:: align_of :: < U > ( ) ,
3952+ ) ;
39683953 // We can't use `rest` again after this, that would invalidate its alias `mut_ptr`!
39693954 // SAFETY: see comments for `align_to`.
39703955 unsafe {
0 commit comments