@@ -2810,6 +2810,36 @@ where
2810
2810
#[ rustc_intrinsic]
2811
2811
pub const fn ptr_metadata < P : ptr:: Pointee < Metadata = M > + PointeeSized , M > ( ptr : * const P ) -> M ;
2812
2812
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
+
2813
2843
/// This is an accidentally-stable alias to [`ptr::copy_nonoverlapping`]; use that instead.
2814
2844
// Note (intentionally not in the doc comment): `ptr::copy_nonoverlapping` adds some extra
2815
2845
// 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;
3206
3236
#[ rustc_intrinsic]
3207
3237
pub const unsafe fn copysignf128 ( x : f128 , y : f128 ) -> f128 ;
3208
3238
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
- =======
3240
3239
/// Generates the LLVM body for the automatic differentiation of `f` using Enzyme,
3241
3240
/// with `df` as the derivative function and `args` as its arguments.
3242
3241
///
@@ -3274,7 +3273,6 @@ fn check_copy_untyped<T>(src: *const T, dst: *mut T, count: usize) -> bool {
3274
3273
#[ rustc_nounwind]
3275
3274
#[ rustc_intrinsic]
3276
3275
pub const fn autodiff < F , G , T : crate :: marker:: Tuple , R > ( f : F , df : G , args : T ) -> R ;
3277
- >>>>>>> subtree/library
3278
3276
3279
3277
/// Inform Miri that a given pointer definitely has a certain alignment.
3280
3278
#[ cfg( miri) ]
0 commit comments