Skip to content

Commit 59a16d2

Browse files
author
gitbot
committed
Merge from 249cb84 with conflicts
2 parents 9b27cfb + 16d4ed0 commit 59a16d2

13 files changed

Lines changed: 63 additions & 0 deletions

File tree

library/alloc/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ edition = "2021"
1111
[dependencies]
1212
core = { path = "../core" }
1313
compiler_builtins = { version = "=0.1.145", features = ['rustc-dep-of-std'] }
14+
<<<<<<< HEAD
1415
safety = { path = "../contracts/safety" }
16+
=======
17+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
1518

1619
[dev-dependencies]
1720
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }

library/alloc/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@
9292
//
9393
// Library features:
9494
// tidy-alphabetical-start
95+
<<<<<<< HEAD
9596
#![cfg_attr(kani, feature(kani))]
97+
=======
98+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
9699
#![cfg_attr(test, feature(str_as_str))]
97100
#![feature(alloc_layout_extra)]
98101
#![feature(allocator_api)]

library/core/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ edition = "2021"
1515
test = false
1616
bench = false
1717

18+
<<<<<<< HEAD
1819
[dependencies]
1920
safety = {path = "../contracts/safety" }
2021

22+
=======
23+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
2124
[features]
2225
# Make panics and failed asserts immediately abort without formatting any message
2326
panic_immediate_abort = []

library/core/src/intrinsics/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4005,13 +4005,16 @@ pub const fn is_val_statically_known<T: Copy>(_arg: T) -> bool {
40054005
#[rustc_intrinsic]
40064006
#[rustc_intrinsic_const_stable_indirect]
40074007
#[rustc_allow_const_fn_unstable(const_swap_nonoverlapping)] // this is anyway not called since CTFE implements the intrinsic
4008+
<<<<<<< HEAD
40084009
#[cfg_attr(kani, kani::modifies(x))]
40094010
#[cfg_attr(kani, kani::modifies(y))]
40104011
#[requires(ub_checks::can_dereference(x) && ub_checks::can_write(x))]
40114012
#[requires(ub_checks::can_dereference(y) && ub_checks::can_write(y))]
40124013
#[requires(x.addr() != y.addr() || core::mem::size_of::<T>() == 0)]
40134014
#[requires(ub_checks::maybe_is_nonoverlapping(x as *const (), y as *const (), size_of::<T>(), 1))]
40144015
#[ensures(|_| ub_checks::can_dereference(x) && ub_checks::can_dereference(y))]
4016+
=======
4017+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
40154018
pub const unsafe fn typed_swap_nonoverlapping<T>(x: *mut T, y: *mut T) {
40164019
// SAFETY: The caller provided single non-overlapping items behind
40174020
// pointers, so swapping them with `count: 1` is fine.

library/core/src/num/int_macros.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,10 @@ macro_rules! int_impl {
21362136
#[must_use = "this returns the result of the operation, \
21372137
without modifying the original"]
21382138
#[inline(always)]
2139+
<<<<<<< HEAD
21392140
#[ensures(|result| *result == self << (rhs & (Self::BITS - 1)))]
2141+
=======
2142+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
21402143
pub const fn wrapping_shl(self, rhs: u32) -> Self {
21412144
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
21422145
// out of bounds
@@ -2166,7 +2169,10 @@ macro_rules! int_impl {
21662169
#[must_use = "this returns the result of the operation, \
21672170
without modifying the original"]
21682171
#[inline(always)]
2172+
<<<<<<< HEAD
21692173
#[ensures(|result| *result == self >> (rhs & (Self::BITS - 1)))]
2174+
=======
2175+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
21702176
pub const fn wrapping_shr(self, rhs: u32) -> Self {
21712177
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
21722178
// out of bounds

library/core/src/num/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,7 @@ macro_rules! from_str_int_impl {
16061606

16071607
from_str_int_impl! { signed isize i8 i16 i32 i64 i128 }
16081608
from_str_int_impl! { unsigned usize u8 u16 u32 u64 u128 }
1609+
<<<<<<< HEAD
16091610

16101611
#[cfg(kani)]
16111612
#[unstable(feature = "kani", issue = "none")]
@@ -2316,3 +2317,5 @@ mod verify {
23162317
checked_f128_to_int_unchecked_usize
23172318
);
23182319
}
2320+
=======
2321+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78

library/core/src/num/uint_macros.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,10 @@ macro_rules! uint_impl {
22382238
#[must_use = "this returns the result of the operation, \
22392239
without modifying the original"]
22402240
#[inline(always)]
2241+
<<<<<<< HEAD
22412242
#[ensures(|result| *result == self << (rhs & (Self::BITS - 1)))]
2243+
=======
2244+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
22422245
pub const fn wrapping_shl(self, rhs: u32) -> Self {
22432246
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
22442247
// out of bounds
@@ -2271,7 +2274,10 @@ macro_rules! uint_impl {
22712274
#[must_use = "this returns the result of the operation, \
22722275
without modifying the original"]
22732276
#[inline(always)]
2277+
<<<<<<< HEAD
22742278
#[ensures(|result| *result == self >> (rhs & (Self::BITS - 1)))]
2279+
=======
2280+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
22752281
pub const fn wrapping_shr(self, rhs: u32) -> Self {
22762282
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
22772283
// out of bounds

library/core/src/ptr/alignment.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ impl Alignment {
5050
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
5151
#[inline]
5252
#[must_use]
53+
<<<<<<< HEAD
5354
#[requires(mem::align_of::<T>().is_power_of_two())]
5455
#[ensures(|result| result.as_usize().is_power_of_two())]
56+
=======
57+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
5558
pub const fn of<T>() -> Self {
5659
// This can't actually panic since type alignment is always a power of two.
5760
const { Alignment::new(mem::align_of::<T>()).unwrap() }

library/core/src/ptr/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,11 @@
396396

397397
use crate::cmp::Ordering;
398398
use crate::intrinsics::const_eval_select;
399+
<<<<<<< HEAD
399400
#[cfg(kani)]
400401
use crate::kani;
402+
=======
403+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
401404
use crate::marker::FnPtr;
402405
use crate::mem::{self, MaybeUninit, SizedTypeProperties};
403406
use crate::{fmt, hash, intrinsics, ub_checks};

library/core/src/ptr/non_null.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ impl<T: ?Sized> NonNull<T> {
333333
#[must_use]
334334
#[inline]
335335
#[stable(feature = "strict_provenance", since = "1.84.0")]
336+
<<<<<<< HEAD
336337
#[ensures(|result| result.get() == self.as_ptr() as *const() as usize)]
338+
=======
339+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
337340
pub fn addr(self) -> NonZero<usize> {
338341
// SAFETY: The pointer is guaranteed by the type to be non-null,
339342
// meaning that the address will be non-zero.
@@ -362,7 +365,10 @@ impl<T: ?Sized> NonNull<T> {
362365
#[must_use]
363366
#[inline]
364367
#[stable(feature = "strict_provenance", since = "1.84.0")]
368+
<<<<<<< HEAD
365369
#[ensures(|result: &Self| !result.as_ptr().is_null() && result.addr() == addr)]
370+
=======
371+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
366372
pub fn with_addr(self, addr: NonZero<usize>) -> Self {
367373
// SAFETY: The result of `ptr::from::with_addr` is non-null because `addr` is guaranteed to be non-zero.
368374
unsafe { NonNull::new_unchecked(self.as_ptr().with_addr(addr.get()) as *mut _) }
@@ -377,7 +383,10 @@ impl<T: ?Sized> NonNull<T> {
377383
#[must_use]
378384
#[inline]
379385
#[stable(feature = "strict_provenance", since = "1.84.0")]
386+
<<<<<<< HEAD
380387
#[ensures(|result: &Self| !result.as_ptr().is_null())]
388+
=======
389+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
381390
pub fn map_addr(self, f: impl FnOnce(NonZero<usize>) -> NonZero<usize>) -> Self {
382391
self.with_addr(f(self.addr()))
383392
}
@@ -737,12 +746,15 @@ impl<T: ?Sized> NonNull<T> {
737746
#[must_use = "returns a new pointer rather than modifying its argument"]
738747
#[stable(feature = "non_null_convenience", since = "1.80.0")]
739748
#[rustc_const_stable(feature = "non_null_convenience", since = "1.80.0")]
749+
<<<<<<< HEAD
740750
#[requires(
741751
count.checked_mul(core::mem::size_of::<T>()).is_some() &&
742752
count * core::mem::size_of::<T>() <= isize::MAX as usize &&
743753
core::ub_checks::same_allocation(self.as_ptr(), self.as_ptr().wrapping_sub(count))
744754
)]
745755
#[ensures(|result: &NonNull<T>| result.as_ptr() == self.as_ptr().offset(-(count as isize)))]
756+
=======
757+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
746758
pub const unsafe fn sub(self, count: usize) -> Self
747759
where
748760
T: Sized,
@@ -1312,9 +1324,12 @@ impl<T: ?Sized> NonNull<T> {
13121324
#[inline(always)]
13131325
#[stable(feature = "non_null_convenience", since = "1.80.0")]
13141326
#[rustc_const_stable(feature = "const_swap", since = "1.85.0")]
1327+
<<<<<<< HEAD
13151328
#[cfg_attr(kani, kani::modifies(self.as_ptr(), with.as_ptr()))]
13161329
#[requires(ub_checks::can_dereference(self.as_ptr()) && ub_checks::can_write(self.as_ptr()))]
13171330
#[requires(ub_checks::can_dereference(with.as_ptr()) && ub_checks::can_write(with.as_ptr()))]
1331+
=======
1332+
>>>>>>> 16d4ed08dbd3f6db3007def332f925f9ca7e6b78
13181333
pub const unsafe fn swap(self, with: NonNull<T>)
13191334
where
13201335
T: Sized,

0 commit comments

Comments
 (0)