@@ -782,36 +782,43 @@ extern "rust-intrinsic" {
782
782
/// characteristics.
783
783
///
784
784
/// The `locality` argument must be a constant integer and is a temporal locality specifier
785
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache
785
+ /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
786
+ ///
787
+ /// This intrinsic does not have a stable counterpart.
786
788
pub fn prefetch_read_data < T > ( data : * const T , locality : i32 ) ;
787
789
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
788
790
/// if supported; otherwise, it is a no-op.
789
791
/// Prefetches have no effect on the behavior of the program but can change its performance
790
792
/// characteristics.
791
793
///
792
794
/// The `locality` argument must be a constant integer and is a temporal locality specifier
793
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache
795
+ /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
796
+ ///
797
+ /// This intrinsic does not have a stable counterpart.
794
798
pub fn prefetch_write_data < T > ( data : * const T , locality : i32 ) ;
795
799
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
796
800
/// if supported; otherwise, it is a no-op.
797
801
/// Prefetches have no effect on the behavior of the program but can change its performance
798
802
/// characteristics.
799
803
///
800
804
/// The `locality` argument must be a constant integer and is a temporal locality specifier
801
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache
805
+ /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
806
+ ///
807
+ /// This intrinsic does not have a stable counterpart.
802
808
pub fn prefetch_read_instruction < T > ( data : * const T , locality : i32 ) ;
803
809
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
804
810
/// if supported; otherwise, it is a no-op.
805
811
/// Prefetches have no effect on the behavior of the program but can change its performance
806
812
/// characteristics.
807
813
///
808
814
/// The `locality` argument must be a constant integer and is a temporal locality specifier
809
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache
815
+ /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
816
+ ///
817
+ /// This intrinsic does not have a stable counterpart.
810
818
pub fn prefetch_write_instruction < T > ( data : * const T , locality : i32 ) ;
811
819
}
812
820
813
821
extern "rust-intrinsic" {
814
-
815
822
/// An atomic fence.
816
823
///
817
824
/// The stabilized version of this intrinsic is available in
@@ -905,12 +912,14 @@ extern "rust-intrinsic" {
905
912
/// that `rustc_peek(potentially_uninitialized)` would actually
906
913
/// double-check that dataflow did indeed compute that it is
907
914
/// uninitialized at that point in the control flow.
915
+ ///
916
+ /// This intrinsic should not be used outside of the compiler.
908
917
pub fn rustc_peek < T > ( _: T ) -> T ;
909
918
910
919
/// Aborts the execution of the process.
911
920
///
912
921
/// The stabilized version of this intrinsic is
913
- /// [`std::process::abort`](../../std/process/fn.abort.html)
922
+ /// [`std::process::abort`](../../std/process/fn.abort.html).
914
923
pub fn abort ( ) -> !;
915
924
916
925
/// Tells LLVM that this point in the code is not reachable, enabling
@@ -932,21 +941,29 @@ extern "rust-intrinsic" {
932
941
/// with optimization of surrounding code and reduce performance. It should
933
942
/// not be used if the invariant can be discovered by the optimizer on its
934
943
/// own, or if it does not enable any significant optimizations.
944
+ ///
945
+ /// This intrinsic does not have a stable counterpart.
935
946
pub fn assume ( b : bool ) ;
936
947
937
948
/// Hints to the compiler that branch condition is likely to be true.
938
949
/// Returns the value passed to it.
939
950
///
940
951
/// Any use other than with `if` statements will probably not have an effect.
952
+ ///
953
+ /// This intrinsic does not have a stable counterpart.
941
954
pub fn likely ( b : bool ) -> bool ;
942
955
943
956
/// Hints to the compiler that branch condition is likely to be false.
944
957
/// Returns the value passed to it.
945
958
///
946
959
/// Any use other than with `if` statements will probably not have an effect.
960
+ ///
961
+ /// This intrinsic does not have a stable counterpart.
947
962
pub fn unlikely ( b : bool ) -> bool ;
948
963
949
964
/// Executes a breakpoint trap, for inspection by a debugger.
965
+ ///
966
+ /// This intrinsic does not have a stable counterpart.
950
967
pub fn breakpoint ( ) ;
951
968
952
969
/// The size of a type in bytes.
@@ -973,6 +990,9 @@ extern "rust-intrinsic" {
973
990
/// [`std::mem::align_of`](../../std/mem/fn.align_of.html).
974
991
#[ rustc_const_stable( feature = "const_min_align_of" , since = "1.40.0" ) ]
975
992
pub fn min_align_of < T > ( ) -> usize ;
993
+ /// The prefered alignment of a type.
994
+ ///
995
+ /// This intrinsic does not have a stable counterpart.
976
996
#[ rustc_const_unstable( feature = "const_pref_align_of" , issue = "none" ) ]
977
997
pub fn pref_align_of < T > ( ) -> usize ;
978
998
@@ -981,6 +1001,10 @@ extern "rust-intrinsic" {
981
1001
/// The stabilized version of this intrinsic is
982
1002
/// [`std::mem::size_of_val`](../../std/mem/fn.size_of_val.html).
983
1003
pub fn size_of_val < T : ?Sized > ( _: * const T ) -> usize ;
1004
+ /// The required alignment of the referenced value.
1005
+ ///
1006
+ /// The stabilized version of this intrinsic is
1007
+ /// [`std::mem::align_of_val`](../../std/mem/fn.align_of_val.html).
984
1008
pub fn min_align_of_val < T : ?Sized > ( _: * const T ) -> usize ;
985
1009
986
1010
/// Gets a static string slice containing the name of a type.
@@ -1001,22 +1025,33 @@ extern "rust-intrinsic" {
1001
1025
1002
1026
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
1003
1027
/// This will statically either panic, or do nothing.
1028
+ ///
1029
+ /// This intrinsic does not have a stable counterpart.
1004
1030
pub fn assert_inhabited < T > ( ) ;
1005
1031
1006
1032
/// A guard for unsafe functions that cannot ever be executed if `T` does not permit
1007
1033
/// zero-initialization: This will statically either panic, or do nothing.
1034
+ ///
1035
+ /// This intrinsic does not have a stable counterpart.
1008
1036
pub fn assert_zero_valid < T > ( ) ;
1009
1037
1010
1038
/// A guard for unsafe functions that cannot ever be executed if `T` has invalid
1011
1039
/// bit patterns: This will statically either panic, or do nothing.
1040
+ ///
1041
+ /// This intrinsic does not have a stable counterpart.
1012
1042
pub fn assert_uninit_valid < T > ( ) ;
1013
1043
1014
1044
/// Gets a reference to a static `Location` indicating where it was called.
1045
+ ///
1046
+ /// Consider using [`std::panic::Location::caller`](../../std/panic/struct.Location.html#method.caller)
1047
+ /// instead.
1015
1048
#[ rustc_const_unstable( feature = "const_caller_location" , issue = "47809" ) ]
1016
1049
pub fn caller_location ( ) -> & ' static crate :: panic:: Location < ' static > ;
1017
1050
1018
1051
/// Moves a value out of scope without running drop glue.
1019
- /// This exists solely for `mem::forget_unsized`; normal `forget` uses `ManuallyDrop` instead.
1052
+ ///
1053
+ /// This exists solely for [`mem::forget_unsized`](../../std/mem/fn.forget_unsized.html);
1054
+ /// normal `forget` uses `ManuallyDrop` instead.
1020
1055
pub fn forget < T : ?Sized > ( _: T ) ;
1021
1056
1022
1057
/// Reinterprets the bits of a value of one type as another type.
@@ -1300,20 +1335,26 @@ extern "rust-intrinsic" {
1300
1335
///
1301
1336
/// The volatile parameter is set to `true`, so it will not be optimized out
1302
1337
/// unless size is equal to zero.
1338
+ ///
1339
+ /// This intrinsic does not have a stable counterpart.
1303
1340
pub fn volatile_copy_nonoverlapping_memory < T > ( dst : * mut T , src : * const T , count : usize ) ;
1304
1341
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
1305
1342
/// a size of `count` * `size_of::<T>()` and an alignment of
1306
1343
/// `min_align_of::<T>()`
1307
1344
///
1308
1345
/// The volatile parameter is set to `true`, so it will not be optimized out
1309
1346
/// unless size is equal to zero.
1347
+ ///
1348
+ /// This intrinsic does not have a stable counterpart.
1310
1349
pub fn volatile_copy_memory < T > ( dst : * mut T , src : * const T , count : usize ) ;
1311
1350
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
1312
1351
/// size of `count` * `size_of::<T>()` and an alignment of
1313
1352
/// `min_align_of::<T>()`.
1314
1353
///
1315
1354
/// The volatile parameter is set to `true`, so it will not be optimized out
1316
1355
/// unless size is equal to zero.
1356
+ ///
1357
+ /// This intrinsic does not have a stable counterpart.
1317
1358
pub fn volatile_set_memory < T > ( dst : * mut T , val : u8 , count : usize ) ;
1318
1359
1319
1360
/// Performs a volatile load from the `src` pointer.
@@ -1329,9 +1370,13 @@ extern "rust-intrinsic" {
1329
1370
1330
1371
/// Performs a volatile load from the `src` pointer
1331
1372
/// The pointer is not required to be aligned.
1373
+ ///
1374
+ /// This intrinsic does not have a stable counterpart.
1332
1375
pub fn unaligned_volatile_load < T > ( src : * const T ) -> T ;
1333
1376
/// Performs a volatile store to the `dst` pointer.
1334
1377
/// The pointer is not required to be aligned.
1378
+ ///
1379
+ /// This intrinsic does not have a stable counterpart.
1335
1380
pub fn unaligned_volatile_store < T > ( dst : * mut T , val : T ) ;
1336
1381
1337
1382
/// Returns the square root of an `f32`
@@ -1539,8 +1584,12 @@ extern "rust-intrinsic" {
1539
1584
pub fn rintf64 ( x : f64 ) -> f64 ;
1540
1585
1541
1586
/// Returns the nearest integer to an `f32`.
1587
+ ///
1588
+ /// This intrinsic does not have a stable counterpart.
1542
1589
pub fn nearbyintf32 ( x : f32 ) -> f32 ;
1543
1590
/// Returns the nearest integer to an `f64`.
1591
+ ///
1592
+ /// This intrinsic does not have a stable counterpart.
1544
1593
pub fn nearbyintf64 ( x : f64 ) -> f64 ;
1545
1594
1546
1595
/// Returns the nearest integer to an `f32`. Rounds half-way cases away from zero.
@@ -1556,28 +1605,39 @@ extern "rust-intrinsic" {
1556
1605
1557
1606
/// Float addition that allows optimizations based on algebraic rules.
1558
1607
/// May assume inputs are finite.
1608
+ ///
1609
+ /// This intrinsic does not have a stable counterpart.
1559
1610
pub fn fadd_fast < T : Copy > ( a : T , b : T ) -> T ;
1560
1611
1561
1612
/// Float subtraction that allows optimizations based on algebraic rules.
1562
1613
/// May assume inputs are finite.
1614
+ ///
1615
+ /// This intrinsic does not have a stable counterpart.
1563
1616
pub fn fsub_fast < T : Copy > ( a : T , b : T ) -> T ;
1564
1617
1565
1618
/// Float multiplication that allows optimizations based on algebraic rules.
1566
1619
/// May assume inputs are finite.
1620
+ ///
1621
+ /// This intrinsic does not have a stable counterpart.
1567
1622
pub fn fmul_fast < T : Copy > ( a : T , b : T ) -> T ;
1568
1623
1569
1624
/// Float division that allows optimizations based on algebraic rules.
1570
1625
/// May assume inputs are finite.
1626
+ ///
1627
+ /// This intrinsic does not have a stable counterpart.
1571
1628
pub fn fdiv_fast < T : Copy > ( a : T , b : T ) -> T ;
1572
1629
1573
1630
/// Float remainder that allows optimizations based on algebraic rules.
1574
1631
/// May assume inputs are finite.
1632
+ ///
1633
+ /// This intrinsic does not have a stable counterpart.
1575
1634
pub fn frem_fast < T : Copy > ( a : T , b : T ) -> T ;
1576
1635
1577
1636
/// Convert with LLVM’s fptoui/fptosi, which may return undef for values out of range
1578
1637
/// (<https://github.com/rust-lang/rust/issues/10184>)
1579
1638
///
1580
- /// Stabilized as `f32::to_int_unchecked` and `f64::to_int_unchecked`.
1639
+ /// Stabilized as [`f32::to_int_unchecked`](../../std/primitive.f32.html#method.to_int_unchecked)
1640
+ /// and [`f64::to_int_unchecked`](../../std/primitive.f64.html#method.to_int_unchecked).
1581
1641
pub fn float_to_int_unchecked < Float : Copy , Int : Copy > ( value : Float ) -> Int ;
1582
1642
1583
1643
/// Returns the number of bits set in an integer type `T`
@@ -1623,6 +1683,8 @@ extern "rust-intrinsic" {
1623
1683
/// Like `ctlz`, but extra-unsafe as it returns `undef` when
1624
1684
/// given an `x` with value `0`.
1625
1685
///
1686
+ /// This intrinsic does not have a stable counterpart.
1687
+ ///
1626
1688
/// # Examples
1627
1689
///
1628
1690
/// ```
@@ -1672,6 +1734,8 @@ extern "rust-intrinsic" {
1672
1734
/// Like `cttz`, but extra-unsafe as it returns `undef` when
1673
1735
/// given an `x` with value `0`.
1674
1736
///
1737
+ /// This intrinsic does not have a stable counterpart.
1738
+ ///
1675
1739
/// # Examples
1676
1740
///
1677
1741
/// ```
@@ -1728,20 +1792,22 @@ extern "rust-intrinsic" {
1728
1792
1729
1793
/// Performs an exact division, resulting in undefined behavior where
1730
1794
/// `x % y != 0` or `y == 0` or `x == T::MIN && y == -1`
1795
+ ///
1796
+ /// This intrinsic does not have a stable counterpart.
1731
1797
pub fn exact_div < T : Copy > ( x : T , y : T ) -> T ;
1732
1798
1733
1799
/// Performs an unchecked division, resulting in undefined behavior
1734
1800
/// where y = 0 or x = `T::MIN` and y = -1
1735
1801
///
1736
- /// The stabilized versions of this intrinsic are available on the integer
1802
+ /// Safe wrappers for this intrinsic are available on the integer
1737
1803
/// primitives via the `checked_div` method. For example,
1738
1804
/// [`std::u32::checked_div`](../../std/primitive.u32.html#method.checked_div)
1739
1805
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1740
1806
pub fn unchecked_div < T : Copy > ( x : T , y : T ) -> T ;
1741
1807
/// Returns the remainder of an unchecked division, resulting in
1742
1808
/// undefined behavior where y = 0 or x = `T::MIN` and y = -1
1743
1809
///
1744
- /// The stabilized versions of this intrinsic are available on the integer
1810
+ /// Safe wrappers for this intrinsic are available on the integer
1745
1811
/// primitives via the `checked_rem` method. For example,
1746
1812
/// [`std::u32::checked_rem`](../../std/primitive.u32.html#method.checked_rem)
1747
1813
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
@@ -1750,32 +1816,38 @@ extern "rust-intrinsic" {
1750
1816
/// Performs an unchecked left shift, resulting in undefined behavior when
1751
1817
/// y < 0 or y >= N, where N is the width of T in bits.
1752
1818
///
1753
- /// The stabilized versions of this intrinsic are available on the integer
1819
+ /// Safe wrappers for this intrinsic are available on the integer
1754
1820
/// primitives via the `checked_shl` method. For example,
1755
1821
/// [`std::u32::checked_shl`](../../std/primitive.u32.html#method.checked_shl)
1756
1822
#[ rustc_const_stable( feature = "const_int_unchecked" , since = "1.40.0" ) ]
1757
1823
pub fn unchecked_shl < T : Copy > ( x : T , y : T ) -> T ;
1758
1824
/// Performs an unchecked right shift, resulting in undefined behavior when
1759
1825
/// y < 0 or y >= N, where N is the width of T in bits.
1760
1826
///
1761
- /// The stabilized versions of this intrinsic are available on the integer
1827
+ /// Safe wrappers for this intrinsic are available on the integer
1762
1828
/// primitives via the `checked_shr` method. For example,
1763
1829
/// [`std::u32::checked_shr`](../../std/primitive.u32.html#method.checked_shr)
1764
1830
#[ rustc_const_stable( feature = "const_int_unchecked" , since = "1.40.0" ) ]
1765
1831
pub fn unchecked_shr < T : Copy > ( x : T , y : T ) -> T ;
1766
1832
1767
1833
/// Returns the result of an unchecked addition, resulting in
1768
1834
/// undefined behavior when `x + y > T::MAX` or `x + y < T::MIN`.
1835
+ ///
1836
+ /// This intrinsic does not have a stable counterpart.
1769
1837
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1770
1838
pub fn unchecked_add < T : Copy > ( x : T , y : T ) -> T ;
1771
1839
1772
1840
/// Returns the result of an unchecked subtraction, resulting in
1773
1841
/// undefined behavior when `x - y > T::MAX` or `x - y < T::MIN`.
1842
+ ///
1843
+ /// This intrinsic does not have a stable counterpart.
1774
1844
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1775
1845
pub fn unchecked_sub < T : Copy > ( x : T , y : T ) -> T ;
1776
1846
1777
1847
/// Returns the result of an unchecked multiplication, resulting in
1778
1848
/// undefined behavior when `x * y > T::MAX` or `x * y < T::MIN`.
1849
+ ///
1850
+ /// This intrinsic does not have a stable counterpart.
1779
1851
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1780
1852
pub fn unchecked_mul < T : Copy > ( x : T , y : T ) -> T ;
1781
1853
0 commit comments