Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
qinheping committed Nov 7, 2024
1 parent d425502 commit 77b6ef4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions library/core/src/alloc/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use crate::{assert_unsafe_precondition, fmt, mem};

#[cfg(kani)]
use crate::kani;
#[cfg(kani)]
use crate::cmp;

// Used only for contract verification.
#[allow(unused_imports)]
Expand Down
1 change: 0 additions & 1 deletion library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,6 @@ from_str_radix_size_impl! { signed i16 isize, unsigned u16 usize }
#[cfg(target_pointer_width = "32")]
from_str_radix_size_impl! { signed i32 isize, unsigned u32 usize }
#[cfg(target_pointer_width = "64")]
from_str_radix_size_impl! { i64 isize, u64 usize }
from_str_radix_size_impl! { signed i64 isize, unsigned u64 usize }

#[cfg(kani)]
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ptr/unique.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl<T: ?Sized> Unique<T> {
#[inline]
#[rustc_const_unstable(feature = "const_align_offset", issue = "90962")]
#[ensures(|result| result.is_none() == ptr.is_null())]
#[ensures(|result| result.is_none() || result.unwrap().as_ptr() == ptr)]x
#[ensures(|result| result.is_none() || result.unwrap().as_ptr() == ptr)]
pub const fn new(ptr: *mut T) -> Option<Self> {
if let Some(pointer) = NonNull::new(ptr) {
Some(Unique { pointer, _marker: PhantomData })
Expand Down

0 comments on commit 77b6ef4

Please sign in to comment.