Skip to content

Commit 9cf5177

Browse files
fix format
1 parent eaab066 commit 9cf5177

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

library/alloc/src/slice.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ use core::cmp::Ordering::{self, Less};
1616
use core::kani;
1717
#[cfg(not(no_global_oom_handling))]
1818
use core::mem::MaybeUninit;
19+
#[cfg(kani)]
20+
use core::mem::SizedTypeProperties;
1921
#[cfg(not(no_global_oom_handling))]
2022
use core::ptr;
23+
#[cfg(kani)]
24+
use core::ptr::slice_from_raw_parts;
2125
#[unstable(feature = "array_windows", issue = "75027")]
2226
pub use core::slice::ArrayWindows;
2327
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
@@ -54,12 +58,6 @@ pub use core::slice::{from_mut_ptr_range, from_ptr_range};
5458
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
5559
#[unstable(feature = "slice_range", issue = "76393")]
5660
pub use core::slice::{range, try_range};
57-
#[cfg(kani)]
58-
use crate::kani;
59-
#[cfg(kani)]
60-
use core::ptr::slice_from_raw_parts;
61-
#[cfg(kani)]
62-
use core::mem::SizedTypeProperties;
6361

6462
////////////////////////////////////////////////////////////////////////////////
6563
// Basic slice extension methods
@@ -70,6 +68,8 @@ use crate::alloc::Global;
7068
#[cfg(not(no_global_oom_handling))]
7169
use crate::borrow::ToOwned;
7270
use crate::boxed::Box;
71+
#[cfg(kani)]
72+
use crate::kani;
7373
use crate::vec::Vec;
7474

7575
impl<T> [T] {
@@ -535,7 +535,7 @@ impl<T> [T] {
535535
#[cfg(kani)]
536536
let buf_ptr = ptr::slice_from_raw_parts(buf.as_ptr(), capacity);
537537
#[cfg(kani)]
538-
let len_ptr = unsafe {(&buf as *const Vec<T> as *const usize).add(2)};
538+
let len_ptr = unsafe { (&buf as *const Vec<T> as *const usize).add(2) };
539539
#[safety::loop_invariant(
540540
kani::mem::same_allocation(buf.as_ptr(), buf.as_ptr().wrapping_add(capacity)) &&
541541
unsafe {*len_ptr <= T::MAX_SLICE_LEN} &&

0 commit comments

Comments
 (0)