@@ -1438,14 +1438,21 @@ extern "rust-intrinsic" {
1438
1438
pub fn frem_fast < T > ( a : T , b : T ) -> T ;
1439
1439
1440
1440
/// Convert with LLVM’s fptoui/fptosi, which may return undef for values out of range
1441
- /// https://github.com/rust-lang/rust/issues/10184
1441
+ /// (<https://github.com/rust-lang/rust/issues/10184>)
1442
+ /// This is under stabilization at <https://github.com/rust-lang/rust/issues/67058>
1442
1443
pub fn float_to_int_approx_unchecked < Float , Int > ( value : Float ) -> Int ;
1443
1444
1444
1445
/// Returns the number of bits set in an integer type `T`
1446
+ /// The stabilized versions of this intrinsic are available on the integer
1447
+ /// primitives via the `count_ones` method. For example,
1448
+ /// [`std::u32::count_ones`](../../std/primitive.u32.html#method.count_ones)
1445
1449
#[ rustc_const_stable( feature = "const_ctpop" , since = "1.40.0" ) ]
1446
1450
pub fn ctpop < T > ( x : T ) -> T ;
1447
1451
1448
1452
/// Returns the number of leading unset bits (zeroes) in an integer type `T`.
1453
+ /// The stabilized versions of this intrinsic are available on the integer
1454
+ /// primitives via the `leading_zeros` method. For example,
1455
+ /// [`std::u32::leading_zeros`](../../std/primitive.u32.html#method.leading_zeros)
1449
1456
///
1450
1457
/// # Examples
1451
1458
///
@@ -1491,6 +1498,9 @@ extern "rust-intrinsic" {
1491
1498
pub fn ctlz_nonzero < T > ( x : T ) -> T ;
1492
1499
1493
1500
/// Returns the number of trailing unset bits (zeroes) in an integer type `T`.
1501
+ /// The stabilized versions of this intrinsic are available on the integer
1502
+ /// primitives via the `trailing_zeros` method. For example,
1503
+ /// [`std::u32::trailing_zeros`](../../std/primitive.u32.html#method.trailing_zeros)
1494
1504
///
1495
1505
/// # Examples
1496
1506
///
@@ -1536,10 +1546,16 @@ extern "rust-intrinsic" {
1536
1546
pub fn cttz_nonzero < T > ( x : T ) -> T ;
1537
1547
1538
1548
/// Reverses the bytes in an integer type `T`.
1549
+ /// The stabilized versions of this intrinsic are available on the integer
1550
+ /// primitives via the `swap_bytes` method. For example,
1551
+ /// [`std::u32::swap_bytes`](../../std/primitive.u32.html#method.swap_bytes)
1539
1552
#[ rustc_const_stable( feature = "const_bswap" , since = "1.40.0" ) ]
1540
1553
pub fn bswap < T > ( x : T ) -> T ;
1541
1554
1542
1555
/// Reverses the bits in an integer type `T`.
1556
+ /// The stabilized versions of this intrinsic are available on the integer
1557
+ /// primitives via the `reverse_bits` method. For example,
1558
+ /// [`std::u32::reverse_bits`](../../std/primitive.u32.html#method.reverse_bits)
1543
1559
#[ rustc_const_stable( feature = "const_bitreverse" , since = "1.40.0" ) ]
1544
1560
pub fn bitreverse < T > ( x : T ) -> T ;
1545
1561
@@ -1569,20 +1585,34 @@ extern "rust-intrinsic" {
1569
1585
pub fn exact_div < T > ( x : T , y : T ) -> T ;
1570
1586
1571
1587
/// Performs an unchecked division, resulting in undefined behavior
1572
- /// where y = 0 or x = `T::min_value()` and y = -1
1588
+ /// where y = 0 or x = `T::min_value()` and y = -1.
1589
+ ///
1590
+ /// The stabilized versions of this intrinsic are available on the integer
1591
+ /// primitives via the `checked_div` method. For example,
1592
+ /// [`std::u32::checked_div`](../../std/primitive.u32.html#method.checked_div)
1573
1593
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1574
1594
pub fn unchecked_div < T > ( x : T , y : T ) -> T ;
1575
1595
/// Returns the remainder of an unchecked division, resulting in
1576
1596
/// undefined behavior where y = 0 or x = `T::min_value()` and y = -1
1597
+ ///
1598
+ /// The stabilized versions of this intrinsic are available on the integer
1599
+ /// primitives via the `checked_rem` method. For example,
1600
+ /// [`std::u32::checked_rem`](../../std/primitive.u32.html#method.checked_rem)
1577
1601
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1578
1602
pub fn unchecked_rem < T > ( x : T , y : T ) -> T ;
1579
1603
1580
1604
/// Performs an unchecked left shift, resulting in undefined behavior when
1581
1605
/// y < 0 or y >= N, where N is the width of T in bits.
1606
+ /// The stabilized versions of this intrinsic are available on the integer
1607
+ /// primitives via the `wrapping_shl` method. For example,
1608
+ /// [`std::u32::wrapping_shl`](../../std/primitive.u32.html#method.wrapping_shl)
1582
1609
#[ rustc_const_stable( feature = "const_int_unchecked" , since = "1.40.0" ) ]
1583
1610
pub fn unchecked_shl < T > ( x : T , y : T ) -> T ;
1584
1611
/// Performs an unchecked right shift, resulting in undefined behavior when
1585
1612
/// y < 0 or y >= N, where N is the width of T in bits.
1613
+ /// The stabilized versions of this intrinsic are available on the integer
1614
+ /// primitives via the `wrapping_shr` method. For example,
1615
+ /// [`std::u32::wrapping_shr`](../../std/primitive.u32.html#method.wrapping_shr)
1586
1616
#[ rustc_const_stable( feature = "const_int_unchecked" , since = "1.40.0" ) ]
1587
1617
pub fn unchecked_shr < T > ( x : T , y : T ) -> T ;
1588
1618
0 commit comments