@@ -1298,30 +1298,10 @@ extern "rust-intrinsic" {
1298
1298
pub fn nontemporal_store < T > ( ptr : * mut T , val : T ) ;
1299
1299
}
1300
1300
1301
- mod real_intrinsics {
1302
- extern "rust-intrinsic" {
1303
- /// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
1304
- /// and destination must *not* overlap.
1305
- /// For the full docs, see the stabilized wrapper [`copy_nonoverlapping`].
1306
- ///
1307
- /// [`copy_nonoverlapping`]: ../../std/ptr/fn.copy_nonoverlapping.html
1308
- pub fn copy_nonoverlapping < T > ( src : * const T , dst : * mut T , count : usize ) ;
1309
-
1310
- /// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
1311
- /// and destination may overlap.
1312
- /// For the full docs, see the stabilized wrapper [`copy`].
1313
- ///
1314
- /// [`copy`]: ../../std/ptr/fn.copy.html
1315
- pub fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
1316
-
1317
- /// Sets `count * size_of::<T>()` bytes of memory starting at `dst` to
1318
- /// `val`.
1319
- /// For the full docs, see the stabilized wrapper [`write_bytes`].
1320
- ///
1321
- /// [`write_bytes`]: ../../std/ptr/fn.write_bytes.html
1322
- pub fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) ;
1323
- }
1324
- }
1301
+ // Some functions are defined here because they accidentally got made
1302
+ // available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>.
1303
+ // (`transmute` also falls into this category, but it cannot be wrapped due to the
1304
+ // check that `T` and `U` have the same size.)
1325
1305
1326
1306
/// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
1327
1307
/// and destination must *not* overlap.
@@ -1409,7 +1389,10 @@ mod real_intrinsics {
1409
1389
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1410
1390
#[ inline]
1411
1391
pub unsafe fn copy_nonoverlapping < T > ( src : * const T , dst : * mut T , count : usize ) {
1412
- real_intrinsics:: copy_nonoverlapping ( src, dst, count) ;
1392
+ extern "rust-intrinsic" {
1393
+ fn copy_nonoverlapping < T > ( src : * const T , dst : * mut T , count : usize ) ;
1394
+ }
1395
+ copy_nonoverlapping ( src, dst, count) ;
1413
1396
}
1414
1397
1415
1398
/// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
@@ -1466,7 +1449,10 @@ pub unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
1466
1449
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1467
1450
#[ inline]
1468
1451
pub unsafe fn copy < T > ( src : * const T , dst : * mut T , count : usize ) {
1469
- real_intrinsics:: copy ( src, dst, count)
1452
+ extern "rust-intrinsic" {
1453
+ fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
1454
+ }
1455
+ copy ( src, dst, count)
1470
1456
}
1471
1457
1472
1458
/// Sets `count * size_of::<T>()` bytes of memory starting at `dst` to
@@ -1544,5 +1530,8 @@ pub unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
1544
1530
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1545
1531
#[ inline]
1546
1532
pub unsafe fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) {
1547
- real_intrinsics:: write_bytes ( dst, val, count)
1533
+ extern "rust-intrinsic" {
1534
+ fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) ;
1535
+ }
1536
+ write_bytes ( dst, val, count)
1548
1537
}
0 commit comments