mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
update cfgs
This commit is contained in:
parent
a9998704d3
commit
0091b8ab2a
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![allow(internal_features)]
|
#![allow(internal_features)]
|
||||||
#![cfg_attr(bootstrap, feature(unsafe_extern_blocks))]
|
|
||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![doc(rust_logo)]
|
#![doc(rust_logo)]
|
||||||
#![feature(assert_matches)]
|
#![feature(assert_matches)]
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![allow(internal_features)]
|
#![allow(internal_features)]
|
||||||
#![allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
#![allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
||||||
#![cfg_attr(bootstrap, feature(unsafe_extern_blocks))]
|
|
||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![doc(rust_logo)]
|
#![doc(rust_logo)]
|
||||||
#![feature(decl_macro)]
|
#![feature(decl_macro)]
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![allow(internal_features)]
|
#![allow(internal_features)]
|
||||||
#![cfg_attr(bootstrap, feature(unsafe_attributes, unsafe_extern_blocks))]
|
|
||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![doc(rust_logo)]
|
#![doc(rust_logo)]
|
||||||
#![feature(rustdoc_internals)]
|
#![feature(rustdoc_internals)]
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#![allow(rustc::diagnostic_outside_of_impl)]
|
#![allow(rustc::diagnostic_outside_of_impl)]
|
||||||
#![allow(rustc::potential_query_instability)]
|
#![allow(rustc::potential_query_instability)]
|
||||||
#![allow(rustc::untranslatable_diagnostic)]
|
#![allow(rustc::untranslatable_diagnostic)]
|
||||||
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns, unsafe_extern_blocks))]
|
|
||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![doc(rust_logo)]
|
#![doc(rust_logo)]
|
||||||
#![feature(allocator_api)]
|
#![feature(allocator_api)]
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![allow(internal_features)]
|
#![allow(internal_features)]
|
||||||
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
|
|
||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![doc(rust_logo)]
|
#![doc(rust_logo)]
|
||||||
#![feature(assert_matches)]
|
#![feature(assert_matches)]
|
||||||
|
@ -87,8 +87,6 @@ where
|
|||||||
pub(crate) fn from_tree(tree: Tree<!, R>) -> Result<Self, Uninhabited> {
|
pub(crate) fn from_tree(tree: Tree<!, R>) -> Result<Self, Uninhabited> {
|
||||||
Ok(match tree {
|
Ok(match tree {
|
||||||
Tree::Byte(b) => Self::from_byte(b),
|
Tree::Byte(b) => Self::from_byte(b),
|
||||||
#[cfg(bootstrap)]
|
|
||||||
Tree::Def(..) => unreachable!(),
|
|
||||||
Tree::Ref(r) => Self::from_ref(r),
|
Tree::Ref(r) => Self::from_ref(r),
|
||||||
Tree::Alt(alts) => {
|
Tree::Alt(alts) => {
|
||||||
let mut alts = alts.into_iter().map(Self::from_tree);
|
let mut alts = alts.into_iter().map(Self::from_tree);
|
||||||
|
@ -91,8 +91,6 @@ pub trait TypeFoldable<I: Interner>: TypeVisitable<I> {
|
|||||||
fn fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self {
|
fn fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self {
|
||||||
match self.try_fold_with(folder) {
|
match self.try_fold_with(folder) {
|
||||||
Ok(t) => t,
|
Ok(t) => t,
|
||||||
#[cfg(bootstrap)]
|
|
||||||
Err(e) => match e {},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,8 +114,6 @@ pub trait TypeSuperFoldable<I: Interner>: TypeFoldable<I> {
|
|||||||
fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self {
|
fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self {
|
||||||
match self.try_super_fold_with(folder) {
|
match self.try_super_fold_with(folder) {
|
||||||
Ok(t) => t,
|
Ok(t) => t,
|
||||||
#[cfg(bootstrap)]
|
|
||||||
Err(e) => match e {},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,8 +121,6 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> {
|
|||||||
{
|
{
|
||||||
match self.try_fold(init, |b, item| Ok::<B, !>(f(b, item))) {
|
match self.try_fold(init, |b, item| Ok::<B, !>(f(b, item))) {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
#[cfg(bootstrap)]
|
|
||||||
Err(e) => match e {},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,8 +241,6 @@ impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A> {
|
|||||||
{
|
{
|
||||||
match self.try_rfold(init, |b, item| Ok::<B, !>(f(b, item))) {
|
match self.try_rfold(init, |b, item| Ok::<B, !>(f(b, item))) {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
#[cfg(bootstrap)]
|
|
||||||
Err(e) => match e {},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,15 +4,6 @@
|
|||||||
#[stable(feature = "simd_arch", since = "1.27.0")]
|
#[stable(feature = "simd_arch", since = "1.27.0")]
|
||||||
pub use crate::core_arch::arch::*;
|
pub use crate::core_arch::arch::*;
|
||||||
|
|
||||||
#[cfg(bootstrap)]
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
|
|
||||||
fn dummy() {
|
|
||||||
// AArch64 also has a target feature named `sm4`, so we need `#![feature(sha512_sm_x86)]` in lib.rs
|
|
||||||
// But as the bootstrap compiler doesn't know about this feature yet, we need to convert it to a
|
|
||||||
// library feature until bootstrap gets bumped
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Inline assembly.
|
/// Inline assembly.
|
||||||
///
|
///
|
||||||
/// Refer to [Rust By Example] for a usage guide and the [reference] for
|
/// Refer to [Rust By Example] for a usage guide and the [reference] for
|
||||||
|
@ -306,7 +306,7 @@ pub use once::OnceCell;
|
|||||||
/// See the [module-level documentation](self) for more.
|
/// See the [module-level documentation](self) for more.
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
|
#[rustc_pub_transparent]
|
||||||
pub struct Cell<T: ?Sized> {
|
pub struct Cell<T: ?Sized> {
|
||||||
value: UnsafeCell<T>,
|
value: UnsafeCell<T>,
|
||||||
}
|
}
|
||||||
@ -2056,7 +2056,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
|
|||||||
#[lang = "unsafe_cell"]
|
#[lang = "unsafe_cell"]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
|
#[rustc_pub_transparent]
|
||||||
pub struct UnsafeCell<T: ?Sized> {
|
pub struct UnsafeCell<T: ?Sized> {
|
||||||
value: T,
|
value: T,
|
||||||
}
|
}
|
||||||
@ -2299,7 +2299,7 @@ impl<T> UnsafeCell<*mut T> {
|
|||||||
/// See [`UnsafeCell`] for details.
|
/// See [`UnsafeCell`] for details.
|
||||||
#[unstable(feature = "sync_unsafe_cell", issue = "95439")]
|
#[unstable(feature = "sync_unsafe_cell", issue = "95439")]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
|
#[rustc_pub_transparent]
|
||||||
pub struct SyncUnsafeCell<T: ?Sized> {
|
pub struct SyncUnsafeCell<T: ?Sized> {
|
||||||
value: UnsafeCell<T>,
|
value: UnsafeCell<T>,
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ pub trait Clone: Sized {
|
|||||||
#[must_use = "cloning is often expensive and is not expected to have side effects"]
|
#[must_use = "cloning is often expensive and is not expected to have side effects"]
|
||||||
// Clone::clone is special because the compiler generates MIR to implement it for some types.
|
// Clone::clone is special because the compiler generates MIR to implement it for some types.
|
||||||
// See InstanceKind::CloneShim.
|
// See InstanceKind::CloneShim.
|
||||||
#[cfg_attr(not(bootstrap), lang = "clone_fn")]
|
#[lang = "clone_fn"]
|
||||||
fn clone(&self) -> Self;
|
fn clone(&self) -> Self;
|
||||||
|
|
||||||
/// Performs copy-assignment from `source`.
|
/// Performs copy-assignment from `source`.
|
||||||
|
@ -103,7 +103,7 @@ use crate::ascii::Char as AsciiChar;
|
|||||||
/// ```
|
/// ```
|
||||||
#[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
|
#[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)]
|
#[rustc_trivial_field_reads]
|
||||||
pub trait Default: Sized {
|
pub trait Default: Sized {
|
||||||
/// Returns the "default value" for a type.
|
/// Returns the "default value" for a type.
|
||||||
///
|
///
|
||||||
|
@ -1020,7 +1020,6 @@ pub const fn unlikely(b: bool) -> bool {
|
|||||||
/// any safety invariants.
|
/// any safety invariants.
|
||||||
///
|
///
|
||||||
/// This intrinsic does not have a stable counterpart.
|
/// This intrinsic does not have a stable counterpart.
|
||||||
#[cfg(not(bootstrap))]
|
|
||||||
#[unstable(feature = "core_intrinsics", issue = "none")]
|
#[unstable(feature = "core_intrinsics", issue = "none")]
|
||||||
#[rustc_intrinsic]
|
#[rustc_intrinsic]
|
||||||
#[rustc_nounwind]
|
#[rustc_nounwind]
|
||||||
@ -1030,12 +1029,6 @@ pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
|
|||||||
if b { true_val } else { false_val }
|
if b { true_val } else { false_val }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(bootstrap)]
|
|
||||||
#[inline]
|
|
||||||
pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
|
|
||||||
if b { true_val } else { false_val }
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "rust-intrinsic" {
|
extern "rust-intrinsic" {
|
||||||
/// Executes a breakpoint trap, for inspection by a debugger.
|
/// Executes a breakpoint trap, for inspection by a debugger.
|
||||||
///
|
///
|
||||||
|
@ -107,7 +107,6 @@
|
|||||||
//
|
//
|
||||||
// Library features:
|
// Library features:
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![cfg_attr(bootstrap, feature(offset_of_nested))]
|
|
||||||
#![feature(array_ptr_get)]
|
#![feature(array_ptr_get)]
|
||||||
#![feature(asm_experimental_arch)]
|
#![feature(asm_experimental_arch)]
|
||||||
#![feature(const_align_of_val)]
|
#![feature(const_align_of_val)]
|
||||||
@ -192,9 +191,6 @@
|
|||||||
//
|
//
|
||||||
// Language features:
|
// Language features:
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![cfg_attr(bootstrap, feature(asm_const))]
|
|
||||||
#![cfg_attr(bootstrap, feature(const_fn_floating_point_arithmetic))]
|
|
||||||
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
|
|
||||||
#![feature(abi_unadjusted)]
|
#![feature(abi_unadjusted)]
|
||||||
#![feature(adt_const_params)]
|
#![feature(adt_const_params)]
|
||||||
#![feature(allow_internal_unsafe)]
|
#![feature(allow_internal_unsafe)]
|
||||||
|
@ -992,7 +992,7 @@ pub macro ConstParamTy($item:item) {
|
|||||||
/* compiler built-in */
|
/* compiler built-in */
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(bootstrap), lang = "unsized_const_param_ty")]
|
#[lang = "unsized_const_param_ty"]
|
||||||
#[unstable(feature = "unsized_const_params", issue = "95174")]
|
#[unstable(feature = "unsized_const_params", issue = "95174")]
|
||||||
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
|
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
|
||||||
/// A marker for types which can be used as types of `const` generic parameters.
|
/// A marker for types which can be used as types of `const` generic parameters.
|
||||||
@ -1002,10 +1002,9 @@ pub macro ConstParamTy($item:item) {
|
|||||||
pub trait UnsizedConstParamTy: StructuralPartialEq + Eq {}
|
pub trait UnsizedConstParamTy: StructuralPartialEq + Eq {}
|
||||||
|
|
||||||
/// Derive macro generating an impl of the trait `ConstParamTy`.
|
/// Derive macro generating an impl of the trait `ConstParamTy`.
|
||||||
#[cfg(not(bootstrap))]
|
#[rustc_builtin_macro]
|
||||||
#[cfg_attr(not(bootstrap), rustc_builtin_macro)]
|
#[allow_internal_unstable(unsized_const_params)]
|
||||||
#[cfg_attr(not(bootstrap), allow_internal_unstable(unsized_const_params))]
|
#[unstable(feature = "unsized_const_params", issue = "95174")]
|
||||||
#[cfg_attr(not(bootstrap), unstable(feature = "unsized_const_params", issue = "95174"))]
|
|
||||||
pub macro UnsizedConstParamTy($item:item) {
|
pub macro UnsizedConstParamTy($item:item) {
|
||||||
/* compiler built-in */
|
/* compiler built-in */
|
||||||
}
|
}
|
||||||
@ -1021,14 +1020,6 @@ marker_impls! {
|
|||||||
(),
|
(),
|
||||||
{T: ConstParamTy_, const N: usize} [T; N],
|
{T: ConstParamTy_, const N: usize} [T; N],
|
||||||
}
|
}
|
||||||
#[cfg(bootstrap)]
|
|
||||||
marker_impls! {
|
|
||||||
#[unstable(feature = "adt_const_params", issue = "95174")]
|
|
||||||
ConstParamTy_ for
|
|
||||||
str,
|
|
||||||
{T: ConstParamTy_} [T],
|
|
||||||
{T: ConstParamTy_ + ?Sized} &T,
|
|
||||||
}
|
|
||||||
|
|
||||||
marker_impls! {
|
marker_impls! {
|
||||||
#[unstable(feature = "unsized_const_params", issue = "95174")]
|
#[unstable(feature = "unsized_const_params", issue = "95174")]
|
||||||
|
@ -47,7 +47,7 @@ use crate::ptr;
|
|||||||
#[lang = "manually_drop"]
|
#[lang = "manually_drop"]
|
||||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
|
#[rustc_pub_transparent]
|
||||||
pub struct ManuallyDrop<T: ?Sized> {
|
pub struct ManuallyDrop<T: ?Sized> {
|
||||||
value: T,
|
value: T,
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ use crate::{fmt, intrinsics, ptr, slice};
|
|||||||
#[lang = "maybe_uninit"]
|
#[lang = "maybe_uninit"]
|
||||||
#[derive(Copy)]
|
#[derive(Copy)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
|
#[rustc_pub_transparent]
|
||||||
pub union MaybeUninit<T> {
|
pub union MaybeUninit<T> {
|
||||||
uninit: (),
|
uninit: (),
|
||||||
value: ManuallyDrop<T>,
|
value: ManuallyDrop<T>,
|
||||||
|
@ -1326,7 +1326,6 @@ impl<T> SizedTypeProperties for T {}
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # #![cfg_attr(bootstrap, feature(offset_of_nested))]
|
|
||||||
/// #![feature(offset_of_enum)]
|
/// #![feature(offset_of_enum)]
|
||||||
///
|
///
|
||||||
/// use std::mem;
|
/// use std::mem;
|
||||||
|
@ -43,8 +43,7 @@ use crate::marker::{ConstParamTy_, UnsizedConstParamTy};
|
|||||||
/// conversions that extend the bits of `Src` with trailing padding to fill
|
/// conversions that extend the bits of `Src` with trailing padding to fill
|
||||||
/// trailing uninitialized bytes of `Self`; e.g.:
|
/// trailing uninitialized bytes of `Self`; e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```rust
|
||||||
#[cfg_attr(not(bootstrap), doc = "```rust")]
|
|
||||||
/// #![feature(transmutability)]
|
/// #![feature(transmutability)]
|
||||||
///
|
///
|
||||||
/// use core::mem::{Assume, TransmuteFrom};
|
/// use core::mem::{Assume, TransmuteFrom};
|
||||||
@ -151,8 +150,7 @@ pub struct Assume {
|
|||||||
/// When `false`, [`TransmuteFrom`] is not implemented for transmutations
|
/// When `false`, [`TransmuteFrom`] is not implemented for transmutations
|
||||||
/// that might violate the alignment requirements of references; e.g.:
|
/// that might violate the alignment requirements of references; e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```compile_fail,E0277
|
||||||
#[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
|
|
||||||
/// #![feature(transmutability)]
|
/// #![feature(transmutability)]
|
||||||
/// use core::mem::{align_of, TransmuteFrom};
|
/// use core::mem::{align_of, TransmuteFrom};
|
||||||
///
|
///
|
||||||
@ -171,8 +169,7 @@ pub struct Assume {
|
|||||||
/// that references in the transmuted value satisfy the alignment
|
/// that references in the transmuted value satisfy the alignment
|
||||||
/// requirements of their referent types; e.g.:
|
/// requirements of their referent types; e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```rust
|
||||||
#[cfg_attr(not(bootstrap), doc = "```rust")]
|
|
||||||
/// #![feature(pointer_is_aligned_to, transmutability)]
|
/// #![feature(pointer_is_aligned_to, transmutability)]
|
||||||
/// use core::mem::{align_of, Assume, TransmuteFrom};
|
/// use core::mem::{align_of, Assume, TransmuteFrom};
|
||||||
///
|
///
|
||||||
@ -203,8 +200,7 @@ pub struct Assume {
|
|||||||
/// that might violate the library safety invariants of the destination
|
/// that might violate the library safety invariants of the destination
|
||||||
/// type; e.g.:
|
/// type; e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```compile_fail,E0277
|
||||||
#[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
|
|
||||||
/// #![feature(transmutability)]
|
/// #![feature(transmutability)]
|
||||||
/// use core::mem::TransmuteFrom;
|
/// use core::mem::TransmuteFrom;
|
||||||
///
|
///
|
||||||
@ -225,8 +221,7 @@ pub struct Assume {
|
|||||||
/// that undefined behavior does not arise from using the transmuted value;
|
/// that undefined behavior does not arise from using the transmuted value;
|
||||||
/// e.g.:
|
/// e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```rust
|
||||||
#[cfg_attr(not(bootstrap), doc = "```rust")]
|
|
||||||
/// #![feature(transmutability)]
|
/// #![feature(transmutability)]
|
||||||
/// use core::mem::{Assume, TransmuteFrom};
|
/// use core::mem::{Assume, TransmuteFrom};
|
||||||
///
|
///
|
||||||
@ -254,8 +249,7 @@ pub struct Assume {
|
|||||||
/// that might violate the language-level bit-validity invariant of the
|
/// that might violate the language-level bit-validity invariant of the
|
||||||
/// destination type; e.g.:
|
/// destination type; e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```compile_fail,E0277
|
||||||
#[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
|
|
||||||
/// #![feature(transmutability)]
|
/// #![feature(transmutability)]
|
||||||
/// use core::mem::TransmuteFrom;
|
/// use core::mem::TransmuteFrom;
|
||||||
///
|
///
|
||||||
@ -271,8 +265,7 @@ pub struct Assume {
|
|||||||
/// that the value being transmuted is a bit-valid instance of the
|
/// that the value being transmuted is a bit-valid instance of the
|
||||||
/// transmuted value; e.g.:
|
/// transmuted value; e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```rust
|
||||||
#[cfg_attr(not(bootstrap), doc = "```rust")]
|
|
||||||
/// #![feature(transmutability)]
|
/// #![feature(transmutability)]
|
||||||
/// use core::mem::{Assume, TransmuteFrom};
|
/// use core::mem::{Assume, TransmuteFrom};
|
||||||
///
|
///
|
||||||
@ -335,9 +328,7 @@ impl Assume {
|
|||||||
/// This is especially useful for extending [`Assume`] in generic contexts;
|
/// This is especially useful for extending [`Assume`] in generic contexts;
|
||||||
/// e.g.:
|
/// e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```rust
|
||||||
#[cfg_attr(not(bootstrap), doc = "```rust")]
|
|
||||||
#[unstable(feature = "transmutability", issue = "99571")]
|
|
||||||
/// #![feature(
|
/// #![feature(
|
||||||
/// adt_const_params,
|
/// adt_const_params,
|
||||||
/// generic_const_exprs,
|
/// generic_const_exprs,
|
||||||
@ -379,6 +370,7 @@ impl Assume {
|
|||||||
/// try_transmute_ref::<_, _, { Assume::NOTHING }>(src)
|
/// try_transmute_ref::<_, _, { Assume::NOTHING }>(src)
|
||||||
/// };
|
/// };
|
||||||
///```
|
///```
|
||||||
|
#[unstable(feature = "transmutability", issue = "99571")]
|
||||||
pub const fn and(self, other_assumptions: Self) -> Self {
|
pub const fn and(self, other_assumptions: Self) -> Self {
|
||||||
Self {
|
Self {
|
||||||
alignment: self.alignment || other_assumptions.alignment,
|
alignment: self.alignment || other_assumptions.alignment,
|
||||||
@ -390,8 +382,7 @@ impl Assume {
|
|||||||
|
|
||||||
/// Remove `other_assumptions` the obligations of `self`; e.g.:
|
/// Remove `other_assumptions` the obligations of `self`; e.g.:
|
||||||
///
|
///
|
||||||
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
|
/// ```rust
|
||||||
#[cfg_attr(not(bootstrap), doc = "```rust")]
|
|
||||||
/// #![feature(transmutability)]
|
/// #![feature(transmutability)]
|
||||||
/// use core::mem::Assume;
|
/// use core::mem::Assume;
|
||||||
///
|
///
|
||||||
|
@ -1084,7 +1084,7 @@ use crate::{cmp, fmt};
|
|||||||
#[lang = "pin"]
|
#[lang = "pin"]
|
||||||
#[fundamental]
|
#[fundamental]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
|
#[rustc_pub_transparent]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Pin<Ptr> {
|
pub struct Pin<Ptr> {
|
||||||
// FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to:
|
// FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to:
|
||||||
|
@ -154,7 +154,7 @@ macro_rules! tuple_impls {
|
|||||||
// Otherwise, it hides the docs entirely.
|
// Otherwise, it hides the docs entirely.
|
||||||
macro_rules! maybe_tuple_doc {
|
macro_rules! maybe_tuple_doc {
|
||||||
($a:ident @ #[$meta:meta] $item:item) => {
|
($a:ident @ #[$meta:meta] $item:item) => {
|
||||||
#[cfg_attr(not(bootstrap), doc(fake_variadic))]
|
#[doc(fake_variadic)]
|
||||||
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
||||||
#[$meta]
|
#[$meta]
|
||||||
$item
|
$item
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![cfg_attr(bootstrap, feature(offset_of_nested))]
|
|
||||||
#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
|
#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
|
||||||
#![cfg_attr(test, feature(cfg_match))]
|
#![cfg_attr(test, feature(cfg_match))]
|
||||||
#![feature(alloc_layout_extra)]
|
#![feature(alloc_layout_extra)]
|
||||||
|
@ -157,9 +157,6 @@ mod imp {
|
|||||||
// going to be cross-lang LTOed anyway. However, using expose is shorter and
|
// going to be cross-lang LTOed anyway. However, using expose is shorter and
|
||||||
// requires less unsafe.
|
// requires less unsafe.
|
||||||
let addr: usize = ptr.expose_provenance();
|
let addr: usize = ptr.expose_provenance();
|
||||||
#[cfg(bootstrap)]
|
|
||||||
let image_base = unsafe { addr_of!(__ImageBase) }.addr();
|
|
||||||
#[cfg(not(bootstrap))]
|
|
||||||
let image_base = addr_of!(__ImageBase).addr();
|
let image_base = addr_of!(__ImageBase).addr();
|
||||||
let offset: usize = addr - image_base;
|
let offset: usize = addr - image_base;
|
||||||
Self(offset as u32)
|
Self(offset as u32)
|
||||||
@ -253,9 +250,6 @@ extern "C" {
|
|||||||
// This is fine since the MSVC runtime uses string comparison on the type name
|
// This is fine since the MSVC runtime uses string comparison on the type name
|
||||||
// to match TypeDescriptors rather than pointer equality.
|
// to match TypeDescriptors rather than pointer equality.
|
||||||
static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor {
|
static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor {
|
||||||
#[cfg(bootstrap)]
|
|
||||||
pVFTable: unsafe { addr_of!(TYPE_INFO_VTABLE) } as *const _,
|
|
||||||
#[cfg(not(bootstrap))]
|
|
||||||
pVFTable: addr_of!(TYPE_INFO_VTABLE) as *const _,
|
pVFTable: addr_of!(TYPE_INFO_VTABLE) as *const _,
|
||||||
spare: core::ptr::null_mut(),
|
spare: core::ptr::null_mut(),
|
||||||
name: TYPE_NAME,
|
name: TYPE_NAME,
|
||||||
|
@ -354,12 +354,8 @@ impl Error for VarError {
|
|||||||
/// }
|
/// }
|
||||||
/// assert_eq!(env::var(key), Ok("VALUE".to_string()));
|
/// assert_eq!(env::var(key), Ok("VALUE".to_string()));
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)]
|
#[rustc_deprecated_safe_2024(
|
||||||
#[cfg_attr(
|
audit_that = "the environment access only happens in single-threaded code"
|
||||||
not(bootstrap),
|
|
||||||
rustc_deprecated_safe_2024(
|
|
||||||
audit_that = "the environment access only happens in single-threaded code"
|
|
||||||
)
|
|
||||||
)]
|
)]
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) {
|
pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) {
|
||||||
@ -424,12 +420,8 @@ pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) {
|
|||||||
/// }
|
/// }
|
||||||
/// assert!(env::var(key).is_err());
|
/// assert!(env::var(key).is_err());
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)]
|
#[rustc_deprecated_safe_2024(
|
||||||
#[cfg_attr(
|
audit_that = "the environment access only happens in single-threaded code"
|
||||||
not(bootstrap),
|
|
||||||
rustc_deprecated_safe_2024(
|
|
||||||
audit_that = "the environment access only happens in single-threaded code"
|
|
||||||
)
|
|
||||||
)]
|
)]
|
||||||
#[stable(feature = "env", since = "1.0.0")]
|
#[stable(feature = "env", since = "1.0.0")]
|
||||||
pub unsafe fn remove_var<K: AsRef<OsStr>>(key: K) {
|
pub unsafe fn remove_var<K: AsRef<OsStr>>(key: K) {
|
||||||
|
@ -272,7 +272,6 @@
|
|||||||
//
|
//
|
||||||
// Language features:
|
// Language features:
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
|
|
||||||
#![feature(alloc_error_handler)]
|
#![feature(alloc_error_handler)]
|
||||||
#![feature(allocator_internals)]
|
#![feature(allocator_internals)]
|
||||||
#![feature(allow_internal_unsafe)]
|
#![feature(allow_internal_unsafe)]
|
||||||
|
@ -118,11 +118,7 @@ pub trait CommandExt: Sealed {
|
|||||||
/// [`pre_exec`]: CommandExt::pre_exec
|
/// [`pre_exec`]: CommandExt::pre_exec
|
||||||
#[stable(feature = "process_exec", since = "1.15.0")]
|
#[stable(feature = "process_exec", since = "1.15.0")]
|
||||||
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
|
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
|
||||||
#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)]
|
#[rustc_deprecated_safe_2024(audit_that = "the closure is async-signal-safe")]
|
||||||
#[cfg_attr(
|
|
||||||
not(bootstrap),
|
|
||||||
rustc_deprecated_safe_2024(audit_that = "the closure is async-signal-safe")
|
|
||||||
)]
|
|
||||||
unsafe fn before_exec<F>(&mut self, f: F) -> &mut process::Command
|
unsafe fn before_exec<F>(&mut self, f: F) -> &mut process::Command
|
||||||
where
|
where
|
||||||
F: FnMut() -> io::Result<()> + Send + Sync + 'static,
|
F: FnMut() -> io::Result<()> + Send + Sync + 'static,
|
||||||
|
@ -458,14 +458,7 @@ pub fn eval_entry<'tcx>(
|
|||||||
panic::resume_unwind(panic_payload)
|
panic::resume_unwind(panic_payload)
|
||||||
});
|
});
|
||||||
// `Ok` can never happen.
|
// `Ok` can never happen.
|
||||||
#[cfg(not(bootstrap))]
|
|
||||||
let Err(res) = res;
|
let Err(res) = res;
|
||||||
#[cfg(bootstrap)]
|
|
||||||
let res = match res {
|
|
||||||
Err(res) => res,
|
|
||||||
// `Ok` can never happen
|
|
||||||
Ok(never) => match never {},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Machine cleanup. Only do this if all threads have terminated; threads that are still running
|
// Machine cleanup. Only do this if all threads have terminated; threads that are still running
|
||||||
// might cause Stacked Borrows errors (https://github.com/rust-lang/miri/issues/2396).
|
// might cause Stacked Borrows errors (https://github.com/rust-lang/miri/issues/2396).
|
||||||
|
Loading…
Reference in New Issue
Block a user