mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Bump bootstrap compiler to 1.33 beta
This commit is contained in:
parent
f95834b2a9
commit
b7f030e114
@ -14,7 +14,7 @@ use crate::Build;
|
|||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
|
|
||||||
// The version number
|
// The version number
|
||||||
pub const CFG_RELEASE_NUM: &str = "1.33.0";
|
pub const CFG_RELEASE_NUM: &str = "1.34.0";
|
||||||
|
|
||||||
pub struct GitInfo {
|
pub struct GitInfo {
|
||||||
inner: Option<Info>,
|
inner: Option<Info>,
|
||||||
|
@ -226,7 +226,7 @@ fn make_win_dist(
|
|||||||
let trim_chars: &[_] = &[' ', '='];
|
let trim_chars: &[_] = &[' ', '='];
|
||||||
let value =
|
let value =
|
||||||
line[(idx + 1)..]
|
line[(idx + 1)..]
|
||||||
.trim_left_matches(trim_chars)
|
.trim_start_matches(trim_chars)
|
||||||
.split(';')
|
.split(';')
|
||||||
.map(PathBuf::from);
|
.map(PathBuf::from);
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ impl Build {
|
|||||||
Command::new(&build.initial_rustc).arg("--version").arg("--verbose"));
|
Command::new(&build.initial_rustc).arg("--version").arg("--verbose"));
|
||||||
let local_release = local_version_verbose
|
let local_release = local_version_verbose
|
||||||
.lines().filter(|x| x.starts_with("release:"))
|
.lines().filter(|x| x.starts_with("release:"))
|
||||||
.next().unwrap().trim_left_matches("release:").trim();
|
.next().unwrap().trim_start_matches("release:").trim();
|
||||||
let my_version = channel::CFG_RELEASE_NUM;
|
let my_version = channel::CFG_RELEASE_NUM;
|
||||||
if local_release.split('.').take(2).eq(my_version.split('.').take(2)) {
|
if local_release.split('.').take(2).eq(my_version.split('.').take(2)) {
|
||||||
build.verbose(&format!("auto-detected local-rebuild {}", local_release));
|
build.verbose(&format!("auto-detected local-rebuild {}", local_release));
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#![cfg_attr(stage0, feature(duration_as_u128))]
|
|
||||||
use std::{collections::VecDeque, time::Instant};
|
use std::{collections::VecDeque, time::Instant};
|
||||||
|
|
||||||
const VECDEQUE_LEN: i32 = 100000;
|
const VECDEQUE_LEN: i32 = 100000;
|
||||||
|
@ -692,7 +692,6 @@ extern "rust-intrinsic" {
|
|||||||
|
|
||||||
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
|
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
|
||||||
/// This will statically either panic, or do nothing.
|
/// This will statically either panic, or do nothing.
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn panic_if_uninhabited<T>();
|
pub fn panic_if_uninhabited<T>();
|
||||||
|
|
||||||
/// Creates a value initialized to zero.
|
/// Creates a value initialized to zero.
|
||||||
|
@ -71,7 +71,6 @@
|
|||||||
#![feature(cfg_target_has_atomic)]
|
#![feature(cfg_target_has_atomic)]
|
||||||
#![feature(concat_idents)]
|
#![feature(concat_idents)]
|
||||||
#![feature(const_fn)]
|
#![feature(const_fn)]
|
||||||
#![cfg_attr(stage0, feature(const_int_ops))]
|
|
||||||
#![feature(const_fn_union)]
|
#![feature(const_fn_union)]
|
||||||
#![feature(custom_attribute)]
|
#![feature(custom_attribute)]
|
||||||
#![feature(doc_cfg)]
|
#![feature(doc_cfg)]
|
||||||
@ -112,19 +111,17 @@
|
|||||||
#![feature(aarch64_target_feature)]
|
#![feature(aarch64_target_feature)]
|
||||||
#![feature(wasm_target_feature)]
|
#![feature(wasm_target_feature)]
|
||||||
#![feature(avx512_target_feature)]
|
#![feature(avx512_target_feature)]
|
||||||
#![cfg_attr(not(stage0), feature(cmpxchg16b_target_feature))]
|
#![feature(cmpxchg16b_target_feature)]
|
||||||
#![feature(const_slice_len)]
|
#![feature(const_slice_len)]
|
||||||
#![feature(const_str_as_bytes)]
|
#![feature(const_str_as_bytes)]
|
||||||
#![feature(const_str_len)]
|
#![feature(const_str_len)]
|
||||||
#![cfg_attr(stage0, feature(const_let))]
|
|
||||||
#![cfg_attr(stage0, feature(const_int_rotate))]
|
|
||||||
#![feature(const_int_conversion)]
|
#![feature(const_int_conversion)]
|
||||||
#![feature(const_transmute)]
|
#![feature(const_transmute)]
|
||||||
#![feature(reverse_bits)]
|
#![feature(reverse_bits)]
|
||||||
#![feature(non_exhaustive)]
|
#![feature(non_exhaustive)]
|
||||||
#![feature(structural_match)]
|
#![feature(structural_match)]
|
||||||
#![feature(abi_unadjusted)]
|
#![feature(abi_unadjusted)]
|
||||||
#![cfg_attr(not(stage0), feature(adx_target_feature))]
|
#![feature(adx_target_feature)]
|
||||||
|
|
||||||
#[prelude_import]
|
#[prelude_import]
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
|
@ -492,7 +492,6 @@ pub const fn needs_drop<T>() -> bool {
|
|||||||
#[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::zeroed` instead")]
|
#[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::zeroed` instead")]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub unsafe fn zeroed<T>() -> T {
|
pub unsafe fn zeroed<T>() -> T {
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::panic_if_uninhabited::<T>();
|
intrinsics::panic_if_uninhabited::<T>();
|
||||||
intrinsics::init()
|
intrinsics::init()
|
||||||
}
|
}
|
||||||
@ -626,7 +625,6 @@ pub unsafe fn zeroed<T>() -> T {
|
|||||||
#[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::uninitialized` instead")]
|
#[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::uninitialized` instead")]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub unsafe fn uninitialized<T>() -> T {
|
pub unsafe fn uninitialized<T>() -> T {
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::panic_if_uninhabited::<T>();
|
intrinsics::panic_if_uninhabited::<T>();
|
||||||
intrinsics::uninit()
|
intrinsics::uninit()
|
||||||
}
|
}
|
||||||
@ -1132,7 +1130,6 @@ impl<T> MaybeUninit<T> {
|
|||||||
#[unstable(feature = "maybe_uninit", issue = "53491")]
|
#[unstable(feature = "maybe_uninit", issue = "53491")]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub unsafe fn into_inner(self) -> T {
|
pub unsafe fn into_inner(self) -> T {
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::panic_if_uninhabited::<T>();
|
intrinsics::panic_if_uninhabited::<T>();
|
||||||
ManuallyDrop::into_inner(self.value)
|
ManuallyDrop::into_inner(self.value)
|
||||||
}
|
}
|
||||||
|
@ -46,17 +46,6 @@ macro_rules! impl_full_ops {
|
|||||||
($($ty:ty: add($addfn:path), mul/div($bigty:ident);)*) => (
|
($($ty:ty: add($addfn:path), mul/div($bigty:ident);)*) => (
|
||||||
$(
|
$(
|
||||||
impl FullOps for $ty {
|
impl FullOps for $ty {
|
||||||
#[cfg(stage0)]
|
|
||||||
fn full_add(self, other: $ty, carry: bool) -> (bool, $ty) {
|
|
||||||
// This cannot overflow; the output is between `0` and `2 * 2^nbits - 1`.
|
|
||||||
// FIXME: will LLVM optimize this into ADC or similar?
|
|
||||||
let (v, carry1) = unsafe { intrinsics::add_with_overflow(self, other) };
|
|
||||||
let (v, carry2) = unsafe {
|
|
||||||
intrinsics::add_with_overflow(v, if carry {1} else {0})
|
|
||||||
};
|
|
||||||
(carry1 || carry2, v)
|
|
||||||
}
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
fn full_add(self, other: $ty, carry: bool) -> (bool, $ty) {
|
fn full_add(self, other: $ty, carry: bool) -> (bool, $ty) {
|
||||||
// This cannot overflow; the output is between `0` and `2 * 2^nbits - 1`.
|
// This cannot overflow; the output is between `0` and `2 * 2^nbits - 1`.
|
||||||
// FIXME: will LLVM optimize this into ADC or similar?
|
// FIXME: will LLVM optimize this into ADC or similar?
|
||||||
|
@ -281,7 +281,6 @@ $EndFeature, "
|
|||||||
```
|
```
|
||||||
"),
|
"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn count_ones(self) -> u32 { (self as $UnsignedT).count_ones() }
|
pub const fn count_ones(self) -> u32 { (self as $UnsignedT).count_ones() }
|
||||||
}
|
}
|
||||||
@ -297,7 +296,6 @@ Basic usage:
|
|||||||
", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 1);", $EndFeature, "
|
", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 1);", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn count_zeros(self) -> u32 {
|
pub const fn count_zeros(self) -> u32 {
|
||||||
(!self).count_ones()
|
(!self).count_ones()
|
||||||
@ -318,7 +316,6 @@ assert_eq!(n.leading_zeros(), 0);",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn leading_zeros(self) -> u32 {
|
pub const fn leading_zeros(self) -> u32 {
|
||||||
(self as $UnsignedT).leading_zeros()
|
(self as $UnsignedT).leading_zeros()
|
||||||
@ -339,7 +336,6 @@ assert_eq!(n.trailing_zeros(), 2);",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn trailing_zeros(self) -> u32 {
|
pub const fn trailing_zeros(self) -> u32 {
|
||||||
(self as $UnsignedT).trailing_zeros()
|
(self as $UnsignedT).trailing_zeros()
|
||||||
@ -363,7 +359,6 @@ let m = ", $rot_result, ";
|
|||||||
assert_eq!(n.rotate_left(", $rot, "), m);
|
assert_eq!(n.rotate_left(", $rot, "), m);
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn rotate_left(self, n: u32) -> Self {
|
pub const fn rotate_left(self, n: u32) -> Self {
|
||||||
(self as $UnsignedT).rotate_left(n) as Self
|
(self as $UnsignedT).rotate_left(n) as Self
|
||||||
@ -388,7 +383,6 @@ let m = ", $rot_op, ";
|
|||||||
assert_eq!(n.rotate_right(", $rot, "), m);
|
assert_eq!(n.rotate_right(", $rot, "), m);
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn rotate_right(self, n: u32) -> Self {
|
pub const fn rotate_right(self, n: u32) -> Self {
|
||||||
(self as $UnsignedT).rotate_right(n) as Self
|
(self as $UnsignedT).rotate_right(n) as Self
|
||||||
@ -410,7 +404,6 @@ let m = n.swap_bytes();
|
|||||||
assert_eq!(m, ", $swapped, ");
|
assert_eq!(m, ", $swapped, ");
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn swap_bytes(self) -> Self {
|
pub const fn swap_bytes(self) -> Self {
|
||||||
(self as $UnsignedT).swap_bytes() as Self
|
(self as $UnsignedT).swap_bytes() as Self
|
||||||
@ -460,7 +453,6 @@ if cfg!(target_endian = \"big\") {
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn from_be(x: Self) -> Self {
|
pub const fn from_be(x: Self) -> Self {
|
||||||
#[cfg(target_endian = "big")]
|
#[cfg(target_endian = "big")]
|
||||||
@ -494,7 +486,6 @@ if cfg!(target_endian = \"little\") {
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn from_le(x: Self) -> Self {
|
pub const fn from_le(x: Self) -> Self {
|
||||||
#[cfg(target_endian = "little")]
|
#[cfg(target_endian = "little")]
|
||||||
@ -528,7 +519,6 @@ if cfg!(target_endian = \"big\") {
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn to_be(self) -> Self { // or not to be?
|
pub const fn to_be(self) -> Self { // or not to be?
|
||||||
#[cfg(target_endian = "big")]
|
#[cfg(target_endian = "big")]
|
||||||
@ -562,7 +552,6 @@ if cfg!(target_endian = \"little\") {
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn to_le(self) -> Self {
|
pub const fn to_le(self) -> Self {
|
||||||
#[cfg(target_endian = "little")]
|
#[cfg(target_endian = "little")]
|
||||||
@ -998,14 +987,8 @@ assert_eq!(", stringify!($SelfT), "::max_value().wrapping_add(2), ", stringify!(
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_add(self, rhs: Self) -> Self {
|
pub const fn wrapping_add(self, rhs: Self) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe {
|
|
||||||
intrinsics::overflowing_add(self, rhs)
|
|
||||||
}
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::overflowing_add(self, rhs)
|
intrinsics::overflowing_add(self, rhs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1025,14 +1008,8 @@ stringify!($SelfT), "::max_value());",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_sub(self, rhs: Self) -> Self {
|
pub const fn wrapping_sub(self, rhs: Self) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe {
|
|
||||||
intrinsics::overflowing_sub(self, rhs)
|
|
||||||
}
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::overflowing_sub(self, rhs)
|
intrinsics::overflowing_sub(self, rhs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1051,14 +1028,8 @@ assert_eq!(11i8.wrapping_mul(12), -124);",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_mul(self, rhs: Self) -> Self {
|
pub const fn wrapping_mul(self, rhs: Self) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe {
|
|
||||||
intrinsics::overflowing_mul(self, rhs)
|
|
||||||
}
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::overflowing_mul(self, rhs)
|
intrinsics::overflowing_mul(self, rhs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1218,7 +1189,6 @@ assert_eq!((-1", stringify!($SelfT), ").wrapping_shl(128), -1);",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_shl(self, rhs: u32) -> Self {
|
pub const fn wrapping_shl(self, rhs: u32) -> Self {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -1246,7 +1216,6 @@ assert_eq!((-128i16).wrapping_shr(64), -128);",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_shr(self, rhs: u32) -> Self {
|
pub const fn wrapping_shr(self, rhs: u32) -> Self {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -1343,14 +1312,8 @@ assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($Sel
|
|||||||
"::MIN, true));", $EndFeature, "
|
"::MIN, true));", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
|
pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
|
||||||
#[cfg(stage0)]
|
|
||||||
let (a, b) = unsafe {
|
|
||||||
intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT)
|
|
||||||
};
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT);
|
let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT);
|
||||||
(a as Self, b)
|
(a as Self, b)
|
||||||
}
|
}
|
||||||
@ -1374,14 +1337,8 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($Sel
|
|||||||
"::MAX, true));", $EndFeature, "
|
"::MAX, true));", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
|
pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
|
||||||
#[cfg(stage0)]
|
|
||||||
let (a, b) = unsafe {
|
|
||||||
intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT)
|
|
||||||
};
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT);
|
let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT);
|
||||||
(a as Self, b)
|
(a as Self, b)
|
||||||
}
|
}
|
||||||
@ -1403,14 +1360,8 @@ assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
|
pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
|
||||||
#[cfg(stage0)]
|
|
||||||
let (a, b) = unsafe {
|
|
||||||
intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT)
|
|
||||||
};
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT);
|
let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT);
|
||||||
(a as Self, b)
|
(a as Self, b)
|
||||||
}
|
}
|
||||||
@ -1594,7 +1545,6 @@ assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
|
pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
|
||||||
(self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
|
(self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
|
||||||
@ -1618,7 +1568,6 @@ assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));",
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
|
pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
|
||||||
(self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
|
(self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
|
||||||
@ -2242,13 +2191,9 @@ Basic usage:
|
|||||||
assert_eq!(n.count_ones(), 3);", $EndFeature, "
|
assert_eq!(n.count_ones(), 3);", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn count_ones(self) -> u32 {
|
pub const fn count_ones(self) -> u32 {
|
||||||
#[cfg(stage0)]
|
intrinsics::ctpop(self as $ActualT) as u32
|
||||||
unsafe { intrinsics::ctpop(self as $ActualT) as u32 }
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
{ intrinsics::ctpop(self as $ActualT) as u32 }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2263,7 +2208,6 @@ Basic usage:
|
|||||||
", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 0);", $EndFeature, "
|
", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 0);", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn count_zeros(self) -> u32 {
|
pub const fn count_zeros(self) -> u32 {
|
||||||
(!self).count_ones()
|
(!self).count_ones()
|
||||||
@ -2283,13 +2227,9 @@ Basic usage:
|
|||||||
assert_eq!(n.leading_zeros(), 2);", $EndFeature, "
|
assert_eq!(n.leading_zeros(), 2);", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn leading_zeros(self) -> u32 {
|
pub const fn leading_zeros(self) -> u32 {
|
||||||
#[cfg(stage0)]
|
intrinsics::ctlz(self as $ActualT) as u32
|
||||||
unsafe { intrinsics::ctlz(self as $ActualT) as u32 }
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
{ intrinsics::ctlz(self as $ActualT) as u32 }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2307,13 +2247,9 @@ Basic usage:
|
|||||||
assert_eq!(n.trailing_zeros(), 3);", $EndFeature, "
|
assert_eq!(n.trailing_zeros(), 3);", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn trailing_zeros(self) -> u32 {
|
pub const fn trailing_zeros(self) -> u32 {
|
||||||
#[cfg(stage0)]
|
intrinsics::cttz(self) as u32
|
||||||
unsafe { intrinsics::cttz(self) as u32 }
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
{ intrinsics::cttz(self) as u32 }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2334,12 +2270,8 @@ let m = ", $rot_result, ";
|
|||||||
assert_eq!(n.rotate_left(", $rot, "), m);
|
assert_eq!(n.rotate_left(", $rot, "), m);
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn rotate_left(self, n: u32) -> Self {
|
pub const fn rotate_left(self, n: u32) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe { intrinsics::rotate_left(self, n as $SelfT) }
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::rotate_left(self, n as $SelfT)
|
intrinsics::rotate_left(self, n as $SelfT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2362,12 +2294,8 @@ let m = ", $rot_op, ";
|
|||||||
assert_eq!(n.rotate_right(", $rot, "), m);
|
assert_eq!(n.rotate_right(", $rot, "), m);
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn rotate_right(self, n: u32) -> Self {
|
pub const fn rotate_right(self, n: u32) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe { intrinsics::rotate_right(self, n as $SelfT) }
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::rotate_right(self, n as $SelfT)
|
intrinsics::rotate_right(self, n as $SelfT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2387,13 +2315,9 @@ let m = n.swap_bytes();
|
|||||||
assert_eq!(m, ", $swapped, ");
|
assert_eq!(m, ", $swapped, ");
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn swap_bytes(self) -> Self {
|
pub const fn swap_bytes(self) -> Self {
|
||||||
#[cfg(stage0)]
|
intrinsics::bswap(self as $ActualT) as Self
|
||||||
unsafe { intrinsics::bswap(self as $ActualT) as Self }
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
{ intrinsics::bswap(self as $ActualT) as Self }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2413,13 +2337,9 @@ let m = n.reverse_bits();
|
|||||||
assert_eq!(m, ", $reversed, ");
|
assert_eq!(m, ", $reversed, ");
|
||||||
```"),
|
```"),
|
||||||
#[unstable(feature = "reverse_bits", issue = "48763")]
|
#[unstable(feature = "reverse_bits", issue = "48763")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_conversion"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn reverse_bits(self) -> Self {
|
pub const fn reverse_bits(self) -> Self {
|
||||||
#[cfg(stage0)]
|
intrinsics::bitreverse(self as $ActualT) as Self
|
||||||
unsafe { intrinsics::bitreverse(self as $ActualT) as Self }
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
{ intrinsics::bitreverse(self as $ActualT) as Self }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2443,7 +2363,6 @@ if cfg!(target_endian = \"big\") {
|
|||||||
}", $EndFeature, "
|
}", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn from_be(x: Self) -> Self {
|
pub const fn from_be(x: Self) -> Self {
|
||||||
#[cfg(target_endian = "big")]
|
#[cfg(target_endian = "big")]
|
||||||
@ -2477,7 +2396,6 @@ if cfg!(target_endian = \"little\") {
|
|||||||
}", $EndFeature, "
|
}", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn from_le(x: Self) -> Self {
|
pub const fn from_le(x: Self) -> Self {
|
||||||
#[cfg(target_endian = "little")]
|
#[cfg(target_endian = "little")]
|
||||||
@ -2511,7 +2429,6 @@ if cfg!(target_endian = \"big\") {
|
|||||||
}", $EndFeature, "
|
}", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn to_be(self) -> Self { // or not to be?
|
pub const fn to_be(self) -> Self { // or not to be?
|
||||||
#[cfg(target_endian = "big")]
|
#[cfg(target_endian = "big")]
|
||||||
@ -2545,7 +2462,6 @@ if cfg!(target_endian = \"little\") {
|
|||||||
}", $EndFeature, "
|
}", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_ops"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn to_le(self) -> Self {
|
pub const fn to_le(self) -> Self {
|
||||||
#[cfg(target_endian = "little")]
|
#[cfg(target_endian = "little")]
|
||||||
@ -2918,14 +2834,8 @@ assert_eq!(200", stringify!($SelfT), ".wrapping_add(", stringify!($SelfT), "::ma
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_add(self, rhs: Self) -> Self {
|
pub const fn wrapping_add(self, rhs: Self) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe {
|
|
||||||
intrinsics::overflowing_add(self, rhs)
|
|
||||||
}
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::overflowing_add(self, rhs)
|
intrinsics::overflowing_add(self, rhs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2944,14 +2854,8 @@ assert_eq!(100", stringify!($SelfT), ".wrapping_sub(", stringify!($SelfT), "::ma
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_sub(self, rhs: Self) -> Self {
|
pub const fn wrapping_sub(self, rhs: Self) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe {
|
|
||||||
intrinsics::overflowing_sub(self, rhs)
|
|
||||||
}
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::overflowing_sub(self, rhs)
|
intrinsics::overflowing_sub(self, rhs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2971,14 +2875,8 @@ $EndFeature, "
|
|||||||
/// assert_eq!(25u8.wrapping_mul(12), 44);
|
/// assert_eq!(25u8.wrapping_mul(12), 44);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_mul(self, rhs: Self) -> Self {
|
pub const fn wrapping_mul(self, rhs: Self) -> Self {
|
||||||
#[cfg(stage0)]
|
|
||||||
unsafe {
|
|
||||||
intrinsics::overflowing_mul(self, rhs)
|
|
||||||
}
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
intrinsics::overflowing_mul(self, rhs)
|
intrinsics::overflowing_mul(self, rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3124,7 +3022,6 @@ Basic usage:
|
|||||||
assert_eq!(1", stringify!($SelfT), ".wrapping_shl(128), 1);", $EndFeature, "
|
assert_eq!(1", stringify!($SelfT), ".wrapping_shl(128), 1);", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_shl(self, rhs: u32) -> Self {
|
pub const fn wrapping_shl(self, rhs: u32) -> Self {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -3154,7 +3051,6 @@ Basic usage:
|
|||||||
assert_eq!(128", stringify!($SelfT), ".wrapping_shr(128), 128);", $EndFeature, "
|
assert_eq!(128", stringify!($SelfT), ".wrapping_shr(128), 128);", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_wrapping"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn wrapping_shr(self, rhs: u32) -> Self {
|
pub const fn wrapping_shr(self, rhs: u32) -> Self {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -3218,14 +3114,8 @@ assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false));
|
|||||||
assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (0, true));", $EndFeature, "
|
assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (0, true));", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
|
pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
|
||||||
#[cfg(stage0)]
|
|
||||||
let (a, b) = unsafe {
|
|
||||||
intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT)
|
|
||||||
};
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT);
|
let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT);
|
||||||
(a as Self, b)
|
(a as Self, b)
|
||||||
}
|
}
|
||||||
@ -3250,14 +3140,8 @@ assert_eq!(0", stringify!($SelfT), ".overflowing_sub(1), (", stringify!($SelfT),
|
|||||||
$EndFeature, "
|
$EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
|
pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
|
||||||
#[cfg(stage0)]
|
|
||||||
let (a, b) = unsafe {
|
|
||||||
intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT)
|
|
||||||
};
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT);
|
let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT);
|
||||||
(a as Self, b)
|
(a as Self, b)
|
||||||
}
|
}
|
||||||
@ -3281,14 +3165,8 @@ $EndFeature, "
|
|||||||
/// assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
|
/// assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
|
pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
|
||||||
#[cfg(stage0)]
|
|
||||||
let (a, b) = unsafe {
|
|
||||||
intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT)
|
|
||||||
};
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT);
|
let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT);
|
||||||
(a as Self, b)
|
(a as Self, b)
|
||||||
}
|
}
|
||||||
@ -3447,7 +3325,6 @@ Basic usage
|
|||||||
assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(132), (0x10, true));", $EndFeature, "
|
assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(132), (0x10, true));", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
|
pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
|
||||||
(self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
|
(self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
|
||||||
@ -3472,7 +3349,6 @@ Basic usage
|
|||||||
assert_eq!(0x10", stringify!($SelfT), ".overflowing_shr(132), (0x1, true));", $EndFeature, "
|
assert_eq!(0x10", stringify!($SelfT), ".overflowing_shr(132), (0x1, true));", $EndFeature, "
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "wrapping", since = "1.7.0")]
|
#[stable(feature = "wrapping", since = "1.7.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_overflowing"))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
|
pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
|
||||||
(self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
|
(self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
|
||||||
|
@ -171,7 +171,7 @@ impl<T: ?Sized> DerefMut for &mut T {
|
|||||||
/// Indicates that a struct can be used as a method receiver, without the
|
/// Indicates that a struct can be used as a method receiver, without the
|
||||||
/// `arbitrary_self_types` feature. This is implemented by stdlib pointer types like `Box<T>`,
|
/// `arbitrary_self_types` feature. This is implemented by stdlib pointer types like `Box<T>`,
|
||||||
/// `Rc<T>`, `&T`, and `Pin<P>`.
|
/// `Rc<T>`, `&T`, and `Pin<P>`.
|
||||||
#[cfg_attr(not(stage0), lang = "receiver")]
|
#[lang = "receiver"]
|
||||||
#[unstable(feature = "receiver_trait", issue = "0")]
|
#[unstable(feature = "receiver_trait", issue = "0")]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub trait Receiver {
|
pub trait Receiver {
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#![panic_runtime]
|
#![panic_runtime]
|
||||||
#![allow(unused_features)]
|
#![allow(unused_features)]
|
||||||
|
|
||||||
#![cfg_attr(stage0, feature(cfg_target_vendor))]
|
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
#![feature(libc)]
|
#![feature(libc)]
|
||||||
#![feature(nll)]
|
#![feature(nll)]
|
||||||
|
@ -24,10 +24,8 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
|
|||||||
#![feature(unicode_internals)]
|
#![feature(unicode_internals)]
|
||||||
#![feature(step_trait)]
|
#![feature(step_trait)]
|
||||||
#![feature(slice_concat_ext)]
|
#![feature(slice_concat_ext)]
|
||||||
#![cfg_attr(stage0, feature(if_while_or_patterns))]
|
|
||||||
#![feature(try_from)]
|
#![feature(try_from)]
|
||||||
#![feature(reverse_bits)]
|
#![feature(reverse_bits)]
|
||||||
#![cfg_attr(stage0, feature(underscore_imports))]
|
|
||||||
|
|
||||||
#![recursion_limit="256"]
|
#![recursion_limit="256"]
|
||||||
|
|
||||||
|
@ -234,12 +234,9 @@
|
|||||||
#![feature(c_variadic)]
|
#![feature(c_variadic)]
|
||||||
#![feature(cfg_target_has_atomic)]
|
#![feature(cfg_target_has_atomic)]
|
||||||
#![feature(cfg_target_thread_local)]
|
#![feature(cfg_target_thread_local)]
|
||||||
#![cfg_attr(stage0, feature(cfg_target_vendor))]
|
|
||||||
#![feature(char_error_internals)]
|
#![feature(char_error_internals)]
|
||||||
#![feature(compiler_builtins_lib)]
|
#![feature(compiler_builtins_lib)]
|
||||||
#![feature(concat_idents)]
|
#![feature(concat_idents)]
|
||||||
#![cfg_attr(stage0, feature(const_int_ops))]
|
|
||||||
#![cfg_attr(stage0, feature(const_ip))]
|
|
||||||
#![feature(const_raw_ptr_deref)]
|
#![feature(const_raw_ptr_deref)]
|
||||||
#![feature(const_cstr_unchecked)]
|
#![feature(const_cstr_unchecked)]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
|
@ -328,7 +328,6 @@ impl Ipv4Addr {
|
|||||||
/// let addr = Ipv4Addr::new(127, 0, 0, 1);
|
/// let addr = Ipv4Addr::new(127, 0, 0, 1);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_ip"))]
|
|
||||||
pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
|
pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
|
||||||
Ipv4Addr {
|
Ipv4Addr {
|
||||||
inner: c::in_addr {
|
inner: c::in_addr {
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
|
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
|
||||||
html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))]
|
html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))]
|
||||||
#![feature(asm)]
|
#![feature(asm)]
|
||||||
#![cfg_attr(stage0, feature(cfg_target_vendor))]
|
|
||||||
#![feature(fnbox)]
|
#![feature(fnbox)]
|
||||||
#![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
|
#![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
|
||||||
#![feature(nll)]
|
#![feature(nll)]
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![unstable(feature = "panic_unwind", issue = "32837")]
|
#![unstable(feature = "panic_unwind", issue = "32837")]
|
||||||
|
|
||||||
#![cfg_attr(stage0, feature(cfg_target_vendor))]
|
|
||||||
#![feature(link_cfg)]
|
#![feature(link_cfg)]
|
||||||
#![feature(nll)]
|
#![feature(nll)]
|
||||||
#![feature(staged_api)]
|
#![feature(staged_api)]
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
|
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
|
||||||
# `0.x.0` for Cargo where they were released on `date`.
|
# `0.x.0` for Cargo where they were released on `date`.
|
||||||
|
|
||||||
date: 2019-01-04
|
date: 2019-01-18
|
||||||
rustc: beta
|
rustc: beta
|
||||||
cargo: beta
|
cargo: beta
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ impl FileEntry {
|
|||||||
fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) {
|
fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) {
|
||||||
if self.ids.is_empty() {
|
if self.ids.is_empty() {
|
||||||
with_attrs_in_source(contents, " id", |fragment, i, _| {
|
with_attrs_in_source(contents, " id", |fragment, i, _| {
|
||||||
let frag = fragment.trim_left_matches("#").to_owned();
|
let frag = fragment.trim_start_matches("#").to_owned();
|
||||||
let encoded = small_url_encode(&frag);
|
let encoded = small_url_encode(&frag);
|
||||||
if !self.ids.insert(frag) {
|
if !self.ids.insert(frag) {
|
||||||
*errors = true;
|
*errors = true;
|
||||||
@ -343,7 +343,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
|
|||||||
Some(i) => i,
|
Some(i) => i,
|
||||||
None => continue,
|
None => continue,
|
||||||
};
|
};
|
||||||
if rest[..pos_equals].trim_left_matches(" ") != "" {
|
if rest[..pos_equals].trim_start_matches(" ") != "" {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,7 +355,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
|
|||||||
};
|
};
|
||||||
let quote_delim = rest.as_bytes()[pos_quote] as char;
|
let quote_delim = rest.as_bytes()[pos_quote] as char;
|
||||||
|
|
||||||
if rest[..pos_quote].trim_left_matches(" ") != "" {
|
if rest[..pos_quote].trim_start_matches(" ") != "" {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let rest = &rest[pos_quote + 1..];
|
let rest = &rest[pos_quote + 1..];
|
||||||
|
@ -188,7 +188,7 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut parts = line.split(',');
|
let mut parts = line.split(',');
|
||||||
let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) {
|
let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) {
|
||||||
Some("active") => Status::Unstable,
|
Some("active") => Status::Unstable,
|
||||||
Some("removed") => Status::Removed,
|
Some("removed") => Status::Removed,
|
||||||
Some("accepted") => Status::Stable,
|
Some("accepted") => Status::Stable,
|
||||||
|
Loading…
Reference in New Issue
Block a user