@@ -1326,30 +1326,10 @@ extern "rust-intrinsic" {
1326
1326
pub fn nontemporal_store < T > ( ptr : * mut T , val : T ) ;
1327
1327
}
1328
1328
1329
- mod real_intrinsics {
1330
- extern "rust-intrinsic" {
1331
- /// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
1332
- /// and destination must *not* overlap.
1333
- /// For the full docs, see the stabilized wrapper [`copy_nonoverlapping`].
1334
- ///
1335
- /// [`copy_nonoverlapping`]: ../../std/ptr/fn.copy_nonoverlapping.html
1336
- pub fn copy_nonoverlapping < T > ( src : * const T , dst : * mut T , count : usize ) ;
1337
-
1338
- /// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
1339
- /// and destination may overlap.
1340
- /// For the full docs, see the stabilized wrapper [`copy`].
1341
- ///
1342
- /// [`copy`]: ../../std/ptr/fn.copy.html
1343
- pub fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
1344
-
1345
- /// Sets `count * size_of::<T>()` bytes of memory starting at `dst` to
1346
- /// `val`.
1347
- /// For the full docs, see the stabilized wrapper [`write_bytes`].
1348
- ///
1349
- /// [`write_bytes`]: ../../std/ptr/fn.write_bytes.html
1350
- pub fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) ;
1351
- }
1352
- }
1329
+ // Some functions are defined here because they accidentally got made
1330
+ // available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>.
1331
+ // (`transmute` also falls into this category, but it cannot be wrapped due to the
1332
+ // check that `T` and `U` have the same size.)
1353
1333
1354
1334
/// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
1355
1335
/// and destination must *not* overlap.
@@ -1437,7 +1417,10 @@ mod real_intrinsics {
1437
1417
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1438
1418
#[ inline]
1439
1419
pub unsafe fn copy_nonoverlapping < T > ( src : * const T , dst : * mut T , count : usize ) {
1440
- real_intrinsics:: copy_nonoverlapping ( src, dst, count) ;
1420
+ extern "rust-intrinsic" {
1421
+ fn copy_nonoverlapping < T > ( src : * const T , dst : * mut T , count : usize ) ;
1422
+ }
1423
+ copy_nonoverlapping ( src, dst, count) ;
1441
1424
}
1442
1425
1443
1426
/// Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source
@@ -1494,7 +1477,10 @@ pub unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
1494
1477
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1495
1478
#[ inline]
1496
1479
pub unsafe fn copy < T > ( src : * const T , dst : * mut T , count : usize ) {
1497
- real_intrinsics:: copy ( src, dst, count)
1480
+ extern "rust-intrinsic" {
1481
+ fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
1482
+ }
1483
+ copy ( src, dst, count)
1498
1484
}
1499
1485
1500
1486
/// Sets `count * size_of::<T>()` bytes of memory starting at `dst` to
@@ -1572,7 +1558,10 @@ pub unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
1572
1558
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1573
1559
#[ inline]
1574
1560
pub unsafe fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) {
1575
- real_intrinsics:: write_bytes ( dst, val, count)
1561
+ extern "rust-intrinsic" {
1562
+ fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) ;
1563
+ }
1564
+ write_bytes ( dst, val, count)
1576
1565
}
1577
1566
1578
1567
// Simple bootstrap implementations of minnum/maxnum for stage0 compilation.
0 commit comments