@@ -1550,36 +1550,36 @@ extern "rust-intrinsic" {
1550
1550
1551
1551
/// Float addition that allows optimizations based on algebraic rules.
1552
1552
/// May assume inputs are finite.
1553
- pub fn fadd_fast < T > ( a : T , b : T ) -> T ;
1553
+ pub fn fadd_fast < T : Copy > ( a : T , b : T ) -> T ;
1554
1554
1555
1555
/// Float subtraction that allows optimizations based on algebraic rules.
1556
1556
/// May assume inputs are finite.
1557
- pub fn fsub_fast < T > ( a : T , b : T ) -> T ;
1557
+ pub fn fsub_fast < T : Copy > ( a : T , b : T ) -> T ;
1558
1558
1559
1559
/// Float multiplication that allows optimizations based on algebraic rules.
1560
1560
/// May assume inputs are finite.
1561
- pub fn fmul_fast < T > ( a : T , b : T ) -> T ;
1561
+ pub fn fmul_fast < T : Copy > ( a : T , b : T ) -> T ;
1562
1562
1563
1563
/// Float division that allows optimizations based on algebraic rules.
1564
1564
/// May assume inputs are finite.
1565
- pub fn fdiv_fast < T > ( a : T , b : T ) -> T ;
1565
+ pub fn fdiv_fast < T : Copy > ( a : T , b : T ) -> T ;
1566
1566
1567
1567
/// Float remainder that allows optimizations based on algebraic rules.
1568
1568
/// May assume inputs are finite.
1569
- pub fn frem_fast < T > ( a : T , b : T ) -> T ;
1569
+ pub fn frem_fast < T : Copy > ( a : T , b : T ) -> T ;
1570
1570
1571
1571
/// Convert with LLVM’s fptoui/fptosi, which may return undef for values out of range
1572
1572
/// (<https://github.com/rust-lang/rust/issues/10184>)
1573
1573
/// This is under stabilization at <https://github.com/rust-lang/rust/issues/67058>
1574
- pub fn float_to_int_approx_unchecked < Float , Int > ( value : Float ) -> Int ;
1574
+ pub fn float_to_int_approx_unchecked < Float : Copy , Int : Copy > ( value : Float ) -> Int ;
1575
1575
1576
1576
/// Returns the number of bits set in an integer type `T`
1577
1577
///
1578
1578
/// The stabilized versions of this intrinsic are available on the integer
1579
1579
/// primitives via the `count_ones` method. For example,
1580
1580
/// [`std::u32::count_ones`](../../std/primitive.u32.html#method.count_ones)
1581
1581
#[ rustc_const_stable( feature = "const_ctpop" , since = "1.40.0" ) ]
1582
- pub fn ctpop < T > ( x : T ) -> T ;
1582
+ pub fn ctpop < T : Copy > ( x : T ) -> T ;
1583
1583
1584
1584
/// Returns the number of leading unset bits (zeroes) in an integer type `T`.
1585
1585
///
@@ -1611,7 +1611,7 @@ extern "rust-intrinsic" {
1611
1611
/// assert_eq!(num_leading, 16);
1612
1612
/// ```
1613
1613
#[ rustc_const_stable( feature = "const_ctlz" , since = "1.40.0" ) ]
1614
- pub fn ctlz < T > ( x : T ) -> T ;
1614
+ pub fn ctlz < T : Copy > ( x : T ) -> T ;
1615
1615
1616
1616
/// Like `ctlz`, but extra-unsafe as it returns `undef` when
1617
1617
/// given an `x` with value `0`.
@@ -1628,7 +1628,7 @@ extern "rust-intrinsic" {
1628
1628
/// assert_eq!(num_leading, 3);
1629
1629
/// ```
1630
1630
#[ rustc_const_unstable( feature = "constctlz" , issue = "none" ) ]
1631
- pub fn ctlz_nonzero < T > ( x : T ) -> T ;
1631
+ pub fn ctlz_nonzero < T : Copy > ( x : T ) -> T ;
1632
1632
1633
1633
/// Returns the number of trailing unset bits (zeroes) in an integer type `T`.
1634
1634
///
@@ -1660,7 +1660,7 @@ extern "rust-intrinsic" {
1660
1660
/// assert_eq!(num_trailing, 16);
1661
1661
/// ```
1662
1662
#[ rustc_const_stable( feature = "const_cttz" , since = "1.40.0" ) ]
1663
- pub fn cttz < T > ( x : T ) -> T ;
1663
+ pub fn cttz < T : Copy > ( x : T ) -> T ;
1664
1664
1665
1665
/// Like `cttz`, but extra-unsafe as it returns `undef` when
1666
1666
/// given an `x` with value `0`.
@@ -1677,51 +1677,51 @@ extern "rust-intrinsic" {
1677
1677
/// assert_eq!(num_trailing, 3);
1678
1678
/// ```
1679
1679
#[ rustc_const_unstable( feature = "const_cttz" , issue = "none" ) ]
1680
- pub fn cttz_nonzero < T > ( x : T ) -> T ;
1680
+ pub fn cttz_nonzero < T : Copy > ( x : T ) -> T ;
1681
1681
1682
1682
/// Reverses the bytes in an integer type `T`.
1683
1683
///
1684
1684
/// The stabilized versions of this intrinsic are available on the integer
1685
1685
/// primitives via the `swap_bytes` method. For example,
1686
1686
/// [`std::u32::swap_bytes`](../../std/primitive.u32.html#method.swap_bytes)
1687
1687
#[ rustc_const_stable( feature = "const_bswap" , since = "1.40.0" ) ]
1688
- pub fn bswap < T > ( x : T ) -> T ;
1688
+ pub fn bswap < T : Copy > ( x : T ) -> T ;
1689
1689
1690
1690
/// Reverses the bits in an integer type `T`.
1691
1691
///
1692
1692
/// The stabilized versions of this intrinsic are available on the integer
1693
1693
/// primitives via the `reverse_bits` method. For example,
1694
1694
/// [`std::u32::reverse_bits`](../../std/primitive.u32.html#method.reverse_bits)
1695
1695
#[ rustc_const_stable( feature = "const_bitreverse" , since = "1.40.0" ) ]
1696
- pub fn bitreverse < T > ( x : T ) -> T ;
1696
+ pub fn bitreverse < T : Copy > ( x : T ) -> T ;
1697
1697
1698
1698
/// Performs checked integer addition.
1699
1699
///
1700
1700
/// The stabilized versions of this intrinsic are available on the integer
1701
1701
/// primitives via the `overflowing_add` method. For example,
1702
1702
/// [`std::u32::overflowing_add`](../../std/primitive.u32.html#method.overflowing_add)
1703
1703
#[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1704
- pub fn add_with_overflow < T > ( x : T , y : T ) -> ( T , bool ) ;
1704
+ pub fn add_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
1705
1705
1706
1706
/// Performs checked integer subtraction
1707
1707
///
1708
1708
/// The stabilized versions of this intrinsic are available on the integer
1709
1709
/// primitives via the `overflowing_sub` method. For example,
1710
1710
/// [`std::u32::overflowing_sub`](../../std/primitive.u32.html#method.overflowing_sub)
1711
1711
#[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1712
- pub fn sub_with_overflow < T > ( x : T , y : T ) -> ( T , bool ) ;
1712
+ pub fn sub_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
1713
1713
1714
1714
/// Performs checked integer multiplication
1715
1715
///
1716
1716
/// The stabilized versions of this intrinsic are available on the integer
1717
1717
/// primitives via the `overflowing_mul` method. For example,
1718
1718
/// [`std::u32::overflowing_mul`](../../std/primitive.u32.html#method.overflowing_mul)
1719
1719
#[ rustc_const_stable( feature = "const_int_overflow" , since = "1.40.0" ) ]
1720
- pub fn mul_with_overflow < T > ( x : T , y : T ) -> ( T , bool ) ;
1720
+ pub fn mul_with_overflow < T : Copy > ( x : T , y : T ) -> ( T , bool ) ;
1721
1721
1722
1722
/// Performs an exact division, resulting in undefined behavior where
1723
1723
/// `x % y != 0` or `y == 0` or `x == T::min_value() && y == -1`
1724
- pub fn exact_div < T > ( x : T , y : T ) -> T ;
1724
+ pub fn exact_div < T : Copy > ( x : T , y : T ) -> T ;
1725
1725
1726
1726
/// Performs an unchecked division, resulting in undefined behavior
1727
1727
/// where y = 0 or x = `T::min_value()` and y = -1
@@ -1730,15 +1730,15 @@ extern "rust-intrinsic" {
1730
1730
/// primitives via the `checked_div` method. For example,
1731
1731
/// [`std::u32::checked_div`](../../std/primitive.u32.html#method.checked_div)
1732
1732
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1733
- pub fn unchecked_div < T > ( x : T , y : T ) -> T ;
1733
+ pub fn unchecked_div < T : Copy > ( x : T , y : T ) -> T ;
1734
1734
/// Returns the remainder of an unchecked division, resulting in
1735
1735
/// undefined behavior where y = 0 or x = `T::min_value()` and y = -1
1736
1736
///
1737
1737
/// The stabilized versions of this intrinsic are available on the integer
1738
1738
/// primitives via the `checked_rem` method. For example,
1739
1739
/// [`std::u32::checked_rem`](../../std/primitive.u32.html#method.checked_rem)
1740
1740
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1741
- pub fn unchecked_rem < T > ( x : T , y : T ) -> T ;
1741
+ pub fn unchecked_rem < T : Copy > ( x : T , y : T ) -> T ;
1742
1742
1743
1743
/// Performs an unchecked left shift, resulting in undefined behavior when
1744
1744
/// y < 0 or y >= N, where N is the width of T in bits.
@@ -1747,83 +1747,83 @@ extern "rust-intrinsic" {
1747
1747
/// primitives via the `checked_shl` method. For example,
1748
1748
/// [`std::u32::checked_shl`](../../std/primitive.u32.html#method.checked_shl)
1749
1749
#[ rustc_const_stable( feature = "const_int_unchecked" , since = "1.40.0" ) ]
1750
- pub fn unchecked_shl < T > ( x : T , y : T ) -> T ;
1750
+ pub fn unchecked_shl < T : Copy > ( x : T , y : T ) -> T ;
1751
1751
/// Performs an unchecked right shift, resulting in undefined behavior when
1752
1752
/// y < 0 or y >= N, where N is the width of T in bits.
1753
1753
///
1754
1754
/// The stabilized versions of this intrinsic are available on the integer
1755
1755
/// primitives via the `checked_shr` method. For example,
1756
1756
/// [`std::u32::checked_shr`](../../std/primitive.u32.html#method.checked_shr)
1757
1757
#[ rustc_const_stable( feature = "const_int_unchecked" , since = "1.40.0" ) ]
1758
- pub fn unchecked_shr < T > ( x : T , y : T ) -> T ;
1758
+ pub fn unchecked_shr < T : Copy > ( x : T , y : T ) -> T ;
1759
1759
1760
1760
/// Returns the result of an unchecked addition, resulting in
1761
1761
/// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
1762
1762
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1763
- pub fn unchecked_add < T > ( x : T , y : T ) -> T ;
1763
+ pub fn unchecked_add < T : Copy > ( x : T , y : T ) -> T ;
1764
1764
1765
1765
/// Returns the result of an unchecked subtraction, resulting in
1766
1766
/// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
1767
1767
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1768
- pub fn unchecked_sub < T > ( x : T , y : T ) -> T ;
1768
+ pub fn unchecked_sub < T : Copy > ( x : T , y : T ) -> T ;
1769
1769
1770
1770
/// Returns the result of an unchecked multiplication, resulting in
1771
1771
/// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`.
1772
1772
#[ rustc_const_unstable( feature = "const_int_unchecked_arith" , issue = "none" ) ]
1773
- pub fn unchecked_mul < T > ( x : T , y : T ) -> T ;
1773
+ pub fn unchecked_mul < T : Copy > ( x : T , y : T ) -> T ;
1774
1774
1775
1775
/// Performs rotate left.
1776
1776
///
1777
1777
/// The stabilized versions of this intrinsic are available on the integer
1778
1778
/// primitives via the `rotate_left` method. For example,
1779
1779
/// [`std::u32::rotate_left`](../../std/primitive.u32.html#method.rotate_left)
1780
1780
#[ rustc_const_stable( feature = "const_int_rotate" , since = "1.40.0" ) ]
1781
- pub fn rotate_left < T > ( x : T , y : T ) -> T ;
1781
+ pub fn rotate_left < T : Copy > ( x : T , y : T ) -> T ;
1782
1782
1783
1783
/// Performs rotate right.
1784
1784
///
1785
1785
/// The stabilized versions of this intrinsic are available on the integer
1786
1786
/// primitives via the `rotate_right` method. For example,
1787
1787
/// [`std::u32::rotate_right`](../../std/primitive.u32.html#method.rotate_right)
1788
1788
#[ rustc_const_stable( feature = "const_int_rotate" , since = "1.40.0" ) ]
1789
- pub fn rotate_right < T > ( x : T , y : T ) -> T ;
1789
+ pub fn rotate_right < T : Copy > ( x : T , y : T ) -> T ;
1790
1790
1791
1791
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.
1792
1792
///
1793
1793
/// The stabilized versions of this intrinsic are available on the integer
1794
1794
/// primitives via the `checked_add` method. For example,
1795
1795
/// [`std::u32::checked_add`](../../std/primitive.u32.html#method.checked_add)
1796
1796
#[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1797
- pub fn wrapping_add < T > ( a : T , b : T ) -> T ;
1797
+ pub fn wrapping_add < T : Copy > ( a : T , b : T ) -> T ;
1798
1798
/// Returns (a - b) mod 2<sup>N</sup>, where N is the width of T in bits.
1799
1799
///
1800
1800
/// The stabilized versions of this intrinsic are available on the integer
1801
1801
/// primitives via the `checked_sub` method. For example,
1802
1802
/// [`std::u32::checked_sub`](../../std/primitive.u32.html#method.checked_sub)
1803
1803
#[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1804
- pub fn wrapping_sub < T > ( a : T , b : T ) -> T ;
1804
+ pub fn wrapping_sub < T : Copy > ( a : T , b : T ) -> T ;
1805
1805
/// Returns (a * b) mod 2<sup>N</sup>, where N is the width of T in bits.
1806
1806
///
1807
1807
/// The stabilized versions of this intrinsic are available on the integer
1808
1808
/// primitives via the `checked_mul` method. For example,
1809
1809
/// [`std::u32::checked_mul`](../../std/primitive.u32.html#method.checked_mul)
1810
1810
#[ rustc_const_stable( feature = "const_int_wrapping" , since = "1.40.0" ) ]
1811
- pub fn wrapping_mul < T > ( a : T , b : T ) -> T ;
1811
+ pub fn wrapping_mul < T : Copy > ( a : T , b : T ) -> T ;
1812
1812
1813
1813
/// Computes `a + b`, while saturating at numeric bounds.
1814
1814
///
1815
1815
/// The stabilized versions of this intrinsic are available on the integer
1816
1816
/// primitives via the `saturating_add` method. For example,
1817
1817
/// [`std::u32::saturating_add`](../../std/primitive.u32.html#method.saturating_add)
1818
1818
#[ rustc_const_stable( feature = "const_int_saturating" , since = "1.40.0" ) ]
1819
- pub fn saturating_add < T > ( a : T , b : T ) -> T ;
1819
+ pub fn saturating_add < T : Copy > ( a : T , b : T ) -> T ;
1820
1820
/// Computes `a - b`, while saturating at numeric bounds.
1821
1821
///
1822
1822
/// The stabilized versions of this intrinsic are available on the integer
1823
1823
/// primitives via the `saturating_sub` method. For example,
1824
1824
/// [`std::u32::saturating_sub`](../../std/primitive.u32.html#method.saturating_sub)
1825
1825
#[ rustc_const_stable( feature = "const_int_saturating" , since = "1.40.0" ) ]
1826
- pub fn saturating_sub < T > ( a : T , b : T ) -> T ;
1826
+ pub fn saturating_sub < T : Copy > ( a : T , b : T ) -> T ;
1827
1827
1828
1828
/// Returns the value of the discriminant for the variant in 'v',
1829
1829
/// cast to a `u64`; if `T` has no discriminant, returns 0.
0 commit comments