Skip to content

Commit d458674

Browse files
committed
Resolve conflicts
1 parent 3fa3dbd commit d458674

File tree

1 file changed

+30
-32
lines changed
  • library/core/src/intrinsics

1 file changed

+30
-32
lines changed

library/core/src/intrinsics/mod.rs

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,6 +2810,36 @@ where
28102810
#[rustc_intrinsic]
28112811
pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + PointeeSized, M>(ptr: *const P) -> M;
28122812

2813+
/// Return whether the initialization state is preserved.
2814+
///
2815+
/// For untyped copy, done via `copy` and `copy_nonoverlapping`, the copies of non-initialized
2816+
/// bytes (such as padding bytes) should result in a non-initialized copy, while copies of
2817+
/// initialized bytes result in initialized bytes.
2818+
///
2819+
/// It is UB to read the uninitialized bytes, so we cannot compare their values only their
2820+
/// initialization state.
2821+
///
2822+
/// This is used for contracts only.
2823+
///
2824+
/// FIXME: Change this once we add support to quantifiers.
2825+
#[allow(dead_code)]
2826+
#[allow(unused_variables)]
2827+
fn check_copy_untyped<T>(src: *const T, dst: *mut T, count: usize) -> bool {
2828+
#[cfg(kani)]
2829+
if count > 0 {
2830+
let byte = kani::any_where(|sz: &usize| *sz < size_of::<T>());
2831+
let elem = kani::any_where(|val: &usize| *val < count);
2832+
let src_data = src as *const u8;
2833+
let dst_data = unsafe { dst.add(elem) } as *const u8;
2834+
ub_checks::can_dereference(unsafe { src_data.add(byte) })
2835+
== ub_checks::can_dereference(unsafe { dst_data.add(byte) })
2836+
} else {
2837+
true
2838+
}
2839+
#[cfg(not(kani))]
2840+
false
2841+
}
2842+
28132843
/// This is an accidentally-stable alias to [`ptr::copy_nonoverlapping`]; use that instead.
28142844
// Note (intentionally not in the doc comment): `ptr::copy_nonoverlapping` adds some extra
28152845
// debug assertions; if you are writing compiler tests or code inside the standard library
@@ -3206,37 +3236,6 @@ pub const unsafe fn copysignf64(x: f64, y: f64) -> f64;
32063236
#[rustc_intrinsic]
32073237
pub const unsafe fn copysignf128(x: f128, y: f128) -> f128;
32083238

3209-
<<<<<<< HEAD
3210-
/// Return whether the initialization state is preserved.
3211-
///
3212-
/// For untyped copy, done via `copy` and `copy_nonoverlapping`, the copies of non-initialized
3213-
/// bytes (such as padding bytes) should result in a non-initialized copy, while copies of
3214-
/// initialized bytes result in initialized bytes.
3215-
///
3216-
/// It is UB to read the uninitialized bytes, so we cannot compare their values only their
3217-
/// initialization state.
3218-
///
3219-
/// This is used for contracts only.
3220-
///
3221-
/// FIXME: Change this once we add support to quantifiers.
3222-
#[allow(dead_code)]
3223-
#[allow(unused_variables)]
3224-
fn check_copy_untyped<T>(src: *const T, dst: *mut T, count: usize) -> bool {
3225-
#[cfg(kani)]
3226-
if count > 0 {
3227-
let byte = kani::any_where(|sz: &usize| *sz < size_of::<T>());
3228-
let elem = kani::any_where(|val: &usize| *val < count);
3229-
let src_data = src as *const u8;
3230-
let dst_data = unsafe { dst.add(elem) } as *const u8;
3231-
ub_checks::can_dereference(unsafe { src_data.add(byte) })
3232-
== ub_checks::can_dereference(unsafe { dst_data.add(byte) })
3233-
} else {
3234-
true
3235-
}
3236-
#[cfg(not(kani))]
3237-
false
3238-
}
3239-
=======
32403239
/// Generates the LLVM body for the automatic differentiation of `f` using Enzyme,
32413240
/// with `df` as the derivative function and `args` as its arguments.
32423241
///
@@ -3274,7 +3273,6 @@ fn check_copy_untyped<T>(src: *const T, dst: *mut T, count: usize) -> bool {
32743273
#[rustc_nounwind]
32753274
#[rustc_intrinsic]
32763275
pub const fn autodiff<F, G, T: crate::marker::Tuple, R>(f: F, df: G, args: T) -> R;
3277-
>>>>>>> subtree/library
32783276

32793277
/// Inform Miri that a given pointer definitely has a certain alignment.
32803278
#[cfg(miri)]

0 commit comments

Comments
 (0)