Handle cfg(bootstrap) throughout

This commit is contained in:
Mark Rousskov 2019-08-11 12:55:14 -04:00
parent e9b3a01764
commit 2601c86487
36 changed files with 64 additions and 179 deletions

View file

@ -132,10 +132,7 @@ fn main() {
cmd.arg("-Dwarnings");
cmd.arg("-Drust_2018_idioms");
cmd.arg("-Dunused_lifetimes");
// cfg(not(bootstrap)): Remove this during the next stage 0 compiler update.
// `-Drustc::internal` is a new feature and `rustc_version` mis-reports the `stage`.
let cfg_not_bootstrap = stage != "0" && crate_name != Some("rustc_version");
if cfg_not_bootstrap && use_internal_lints(crate_name) {
if use_internal_lints(crate_name) {
cmd.arg("-Zunstable-options");
cmd.arg("-Drustc::internal");
}

View file

@ -145,7 +145,7 @@ impl StepDescription {
only_hosts: S::ONLY_HOSTS,
should_run: S::should_run,
make_run: S::make_run,
name: unsafe { ::std::intrinsics::type_name::<S>() },
name: std::any::type_name::<S>(),
}
}

View file

@ -106,8 +106,8 @@ impl<K, V> LeafNode<K, V> {
LeafNode {
// As a general policy, we leave fields uninitialized if they can be, as this should
// be both slightly faster and easier to track in Valgrind.
keys: uninit_array![_; CAPACITY],
vals: uninit_array![_; CAPACITY],
keys: [MaybeUninit::UNINIT; CAPACITY],
vals: [MaybeUninit::UNINIT; CAPACITY],
parent: ptr::null(),
parent_idx: MaybeUninit::uninit(),
len: 0
@ -159,7 +159,7 @@ impl<K, V> InternalNode<K, V> {
unsafe fn new() -> Self {
InternalNode {
data: LeafNode::new(),
edges: uninit_array![_; 2*B],
edges: [MaybeUninit::UNINIT; 2*B]
}
}
}

View file

@ -69,7 +69,7 @@
#![warn(missing_debug_implementations)]
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
#![allow(explicit_outlives_requirements)]
#![cfg_attr(not(bootstrap), allow(incomplete_features))]
#![allow(incomplete_features)]
#![cfg_attr(not(test), feature(generator_trait))]
#![cfg_attr(test, feature(test))]
@ -84,7 +84,7 @@
#![feature(coerce_unsized)]
#![feature(const_generic_impls_guard)]
#![feature(const_generics)]
#![cfg_attr(not(bootstrap), feature(const_in_array_repeat_expressions))]
#![feature(const_in_array_repeat_expressions)]
#![feature(dispatch_from_dyn)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
@ -118,7 +118,7 @@
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]
#![feature(slice_partition_dedup)]
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_array)]
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
#![feature(alloc_layout_extra)]
#![feature(try_trait)]
#![feature(mem_take)]

View file

@ -470,10 +470,5 @@ impl TypeId {
#[stable(feature = "type_name", since = "1.38.0")]
#[rustc_const_unstable(feature = "const_type_name")]
pub const fn type_name<T: ?Sized>() -> &'static str {
#[cfg(bootstrap)]
unsafe {
intrinsics::type_name::<T>()
}
#[cfg(not(bootstrap))]
intrinsics::type_name::<T>()
}

View file

@ -553,12 +553,7 @@ impl char {
/// `XID_Start` is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to `ID_Start` but modified for closure under `NFKx`.
#[cfg_attr(bootstrap,
unstable(feature = "rustc_private",
reason = "mainly needed for compiler internals",
issue = "27812"))]
#[cfg_attr(not(bootstrap),
unstable(feature = "unicode_internals", issue = "0"))]
#[unstable(feature = "unicode_internals", issue = "0")]
pub fn is_xid_start(self) -> bool {
derived_property::XID_Start(self)
}
@ -569,12 +564,7 @@ impl char {
/// `XID_Continue` is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to `ID_Continue` but modified for closure under NFKx.
#[cfg_attr(bootstrap,
unstable(feature = "rustc_private",
reason = "mainly needed for compiler internals",
issue = "27812"))]
#[cfg_attr(not(bootstrap),
unstable(feature = "unicode_internals", issue = "0"))]
#[unstable(feature = "unicode_internals", issue = "0")]
#[inline]
pub fn is_xid_continue(self) -> bool {
derived_property::XID_Continue(self)

View file

@ -134,7 +134,6 @@ pub trait Clone : Sized {
}
/// Derive macro generating an impl of the trait `Clone`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

View file

@ -201,7 +201,6 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
}
/// Derive macro generating an impl of the trait `PartialEq`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
@ -265,7 +264,6 @@ pub trait Eq: PartialEq<Self> {
}
/// Derive macro generating an impl of the trait `Eq`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
@ -617,7 +615,6 @@ pub trait Ord: Eq + PartialOrd<Self> {
}
/// Derive macro generating an impl of the trait `Ord`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
@ -867,7 +864,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
}
/// Derive macro generating an impl of the trait `PartialOrd`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

View file

@ -116,7 +116,6 @@ pub trait Default: Sized {
}
/// Derive macro generating an impl of the trait `Default`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

View file

@ -546,7 +546,6 @@ pub trait Debug {
}
// Separate module to reexport the macro `Debug` from prelude without the trait `Debug`.
#[cfg(not(bootstrap))]
pub(crate) mod macros {
/// Derive macro generating an impl of the trait `Debug`.
#[rustc_builtin_macro]
@ -555,7 +554,6 @@ pub(crate) mod macros {
#[allow_internal_unstable(core_intrinsics)]
pub macro Debug($item:item) { /* compiler built-in */ }
}
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(inline)]
pub use macros::Debug;

View file

@ -199,7 +199,6 @@ pub trait Hash {
}
// Separate module to reexport the macro `Hash` from prelude without the trait `Hash`.
#[cfg(not(bootstrap))]
pub(crate) mod macros {
/// Derive macro generating an impl of the trait `Hash`.
#[rustc_builtin_macro]
@ -208,7 +207,6 @@ pub(crate) mod macros {
#[allow_internal_unstable(core_intrinsics)]
pub macro Hash($item:item) { /* compiler built-in */ }
}
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(inline)]
pub use macros::Hash;

View file

@ -63,7 +63,7 @@
#![warn(missing_debug_implementations)]
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
#![allow(explicit_outlives_requirements)]
#![cfg_attr(not(bootstrap), allow(incomplete_features))]
#![allow(incomplete_features)]
#![feature(allow_internal_unstable)]
#![feature(arbitrary_self_types)]
@ -129,7 +129,7 @@
#![feature(structural_match)]
#![feature(abi_unadjusted)]
#![feature(adx_target_feature)]
#![feature(maybe_uninit_slice, maybe_uninit_array)]
#![feature(maybe_uninit_slice)]
#![feature(external_doc)]
#![feature(mem_take)]
#![feature(associated_type_bounds)]

View file

@ -635,46 +635,11 @@ macro_rules! todo {
($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)+)));
}
/// Creates an array of [`MaybeUninit`].
///
/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
/// It exists solely because bootstrap does not yet support const array-init expressions.
///
/// [`MaybeUninit`]: mem/union.MaybeUninit.html
// FIXME: Remove both versions of this macro once bootstrap is 1.38.
#[macro_export]
#[unstable(feature = "maybe_uninit_array", issue = "53491")]
#[cfg(bootstrap)]
macro_rules! uninit_array {
// This `assume_init` is safe because an array of `MaybeUninit` does not
// require initialization.
($t:ty; $size:expr) => (unsafe {
MaybeUninit::<[MaybeUninit<$t>; $size]>::uninit().assume_init()
});
}
/// Creates an array of [`MaybeUninit`].
///
/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
/// It exists solely because bootstrap does not yet support const array-init expressions.
///
/// [`MaybeUninit`]: mem/union.MaybeUninit.html
// FIXME: Just inline this version of the macro once bootstrap is 1.38.
#[macro_export]
#[unstable(feature = "maybe_uninit_array", issue = "53491")]
#[cfg(not(bootstrap))]
macro_rules! uninit_array {
($t:ty; $size:expr) => (
[MaybeUninit::<$t>::UNINIT; $size]
);
}
/// Definitions of built-in macros.
///
/// Most of the macro properties (stability, visibility, etc.) are taken from the source code here,
/// with exception of expansion functions transforming macro inputs into outputs,
/// those functions are provided by the compiler.
#[cfg(not(bootstrap))]
pub(crate) mod builtin {
/// Causes compilation to fail with the given error message when encountered.

View file

@ -289,7 +289,6 @@ pub trait Copy : Clone {
}
/// Derive macro generating an impl of the trait `Copy`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

View file

@ -213,7 +213,7 @@ use crate::mem::ManuallyDrop;
#[allow(missing_debug_implementations)]
#[stable(feature = "maybe_uninit", since = "1.36.0")]
// Lang item so we can wrap other types in it. This is useful for generators.
#[cfg_attr(not(bootstrap), lang = "maybe_uninit")]
#[lang = "maybe_uninit"]
#[derive(Copy)]
#[repr(transparent)]
pub union MaybeUninit<T> {

View file

@ -453,7 +453,7 @@ pub const fn needs_drop<T>() -> bool {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
#[allow(deprecated_in_future)]
#[allow(deprecated)]
pub unsafe fn zeroed<T>() -> T {
intrinsics::panic_if_uninhabited::<T>();
@ -481,7 +481,7 @@ pub unsafe fn zeroed<T>() -> T {
#[inline]
#[rustc_deprecated(since = "1.39.0", reason = "use `mem::MaybeUninit` instead")]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
#[allow(deprecated_in_future)]
#[allow(deprecated)]
pub unsafe fn uninitialized<T>() -> T {
intrinsics::panic_if_uninhabited::<T>();

View file

@ -46,16 +46,13 @@ pub use crate::option::Option::{self, Some, None};
pub use crate::result::Result::{self, Ok, Err};
// Re-exported built-in macros
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use crate::fmt::macros::Debug;
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use crate::hash::macros::Hash;
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use crate::{
@ -83,7 +80,6 @@ pub use crate::{
trace_macros,
};
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow(deprecated)]
#[doc(no_inline)]

View file

@ -1355,7 +1355,7 @@ struct LateLintPassObjects<'a> {
lints: &'a mut [LateLintPassObject],
}
#[cfg_attr(not(bootstrap), allow(rustc::lint_pass_impl_without_macro))]
#[allow(rustc::lint_pass_impl_without_macro)]
impl LintPass for LateLintPassObjects<'_> {
fn name(&self) -> &'static str {
panic!()
@ -1525,7 +1525,7 @@ struct EarlyLintPassObjects<'a> {
lints: &'a mut [EarlyLintPassObject],
}
#[cfg_attr(not(bootstrap), allow(rustc::lint_pass_impl_without_macro))]
#[allow(rustc::lint_pass_impl_without_macro)]
impl LintPass for EarlyLintPassObjects<'_> {
fn name(&self) -> &'static str {
panic!()

View file

@ -23,7 +23,7 @@ pub struct DefaultHashTypes {
impl DefaultHashTypes {
// we are allowed to use `HashMap` and `HashSet` as identifiers for implementing the lint itself
#[cfg_attr(not(bootstrap), allow(rustc::default_hash_types))]
#[allow(rustc::default_hash_types)]
pub fn new() -> Self {
let mut map = FxHashMap::default();
map.insert(sym::HashMap, sym::FxHashMap);

View file

@ -27,7 +27,7 @@ pub trait EncodableWithShorthand: Clone + Eq + Hash {
fn variant(&self) -> &Self::Variant;
}
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
impl<'tcx> EncodableWithShorthand for Ty<'tcx> {
type Variant = ty::TyKind<'tcx>;
fn variant(&self) -> &Self::Variant {
@ -160,7 +160,7 @@ where
Ok(decoder.map_encoded_cnum_to_current(cnum))
}
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
#[inline]
pub fn decode_ty<D>(decoder: &mut D) -> Result<Ty<'tcx>, D::Error>
where

View file

@ -130,7 +130,7 @@ impl<'tcx> CtxtInterners<'tcx> {
}
/// Intern a type
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
#[inline(never)]
fn intern_ty(&self,
st: TyKind<'tcx>
@ -2076,7 +2076,7 @@ impl<'tcx> Hash for Interned<'tcx, TyS<'tcx>> {
}
}
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
impl<'tcx> Borrow<TyKind<'tcx>> for Interned<'tcx, TyS<'tcx>> {
fn borrow<'a>(&'a self) -> &'a TyKind<'tcx> {
&self.0.sty
@ -2291,7 +2291,7 @@ impl<'tcx> TyCtxt<'tcx> {
self.mk_fn_ptr(converted_sig)
}
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
#[inline]
pub fn mk_ty(&self, st: TyKind<'tcx>) -> Ty<'tcx> {
self.interners.intern_ty(st)

View file

@ -18,7 +18,7 @@ impl FlagComputation {
}
}
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
pub fn for_sty(st: &ty::TyKind<'_>) -> FlagComputation {
let mut result = FlagComputation::new();
result.add_sty(st);
@ -62,7 +62,7 @@ impl FlagComputation {
} // otherwise, this binder captures nothing
}
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
fn add_sty(&mut self, st: &ty::TyKind<'_>) {
match st {
&ty::Bool |

View file

@ -483,7 +483,7 @@ bitflags! {
}
}
#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#[allow(rustc::usage_of_ty_tykind)]
pub struct TyS<'tcx> {
pub sty: TyKind<'tcx>,
pub flags: TypeFlags,

View file

@ -1,6 +1,6 @@
//! This module contains `TyKind` and its major components.
#![cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))]
#![allow(rustc::usage_of_ty_tykind)]
use crate::hir;
use crate::hir::def_id::DefId;

View file

@ -27,7 +27,7 @@
#![cfg_attr(unix, feature(libc))]
#![cfg_attr(not(bootstrap), allow(rustc::default_hash_types))]
#![allow(rustc::default_hash_types)]
#[macro_use]
extern crate log;

View file

@ -1,5 +1,5 @@
#![feature(proc_macro_hygiene)]
#![cfg_attr(not(bootstrap), allow(rustc::default_hash_types))]
#![allow(rustc::default_hash_types)]
#![recursion_limit="128"]

View file

@ -114,26 +114,20 @@ impl TargetDataLayout {
[p] if p.starts_with("P") => {
dl.instruction_address_space = parse_address_space(&p[1..], "P")?
}
// FIXME: Ping cfg(bootstrap) -- Use `ref a @ ..` with new bootstrap compiler.
["a", ..] => {
let a = &spec_parts[1..]; // FIXME inline into pattern.
["a", ref a @ ..] => {
dl.aggregate_align = align(a, "a")?
}
["f32", ..] => {
let a = &spec_parts[1..]; // FIXME inline into pattern.
["f32", ref a @ ..] => {
dl.f32_align = align(a, "f32")?
}
["f64", ..] => {
let a = &spec_parts[1..]; // FIXME inline into pattern.
["f64", ref a @ ..] => {
dl.f64_align = align(a, "f64")?
}
[p @ "p", s, ..] | [p @ "p0", s, ..] => {
let a = &spec_parts[2..]; // FIXME inline into pattern.
[p @ "p", s, ref a @ ..] | [p @ "p0", s, ref a @ ..] => {
dl.pointer_size = size(s, p)?;
dl.pointer_align = align(a, p)?;
}
[s, ..] if s.starts_with("i") => {
let a = &spec_parts[1..]; // FIXME inline into pattern.
[s, ref a @ ..] if s.starts_with("i") => {
let bits = match s[1..].parse::<u64>() {
Ok(bits) => bits,
Err(_) => {
@ -157,8 +151,7 @@ impl TargetDataLayout {
dl.i128_align = a;
}
}
[s, ..] if s.starts_with("v") => {
let a = &spec_parts[1..]; // FIXME inline into pattern.
[s, ref a @ ..] if s.starts_with("v") => {
let v_size = size(&s[1..], "v")?;
let a = align(a, s)?;
if let Some(v) = dl.vector_align.iter_mut().find(|v| v.0 == v_size) {

View file

@ -1834,9 +1834,7 @@ fn bad_variant_count<'tcx>(tcx: TyCtxt<'tcx>, adt: &'tcx ty::AdtDef, sp: Span, d
);
let mut err = struct_span_err!(tcx.sess, sp, E0731, "transparent enum {}", msg);
err.span_label(sp, &msg);
if let &[.., ref end] = &variant_spans[..] {
// FIXME: Ping cfg(bootstrap) -- Use `ref start @ ..` with new bootstrap compiler.
let start = &variant_spans[..variant_spans.len() - 1];
if let &[ref start @ .., ref end] = &variant_spans[..] {
for variant_span in start {
err.span_label(*variant_span, "");
}

View file

@ -228,7 +228,7 @@
// std is implemented with unstable features, many of which are internal
// compiler details that will never be stable
// NB: the following list is sorted to minimize merge conflicts.
#![cfg_attr(not(bootstrap), feature(__rust_unstable_column))]
#![feature(__rust_unstable_column)]
#![feature(alloc_error_handler)]
#![feature(alloc_layout_extra)]
#![feature(allocator_api)]
@ -513,7 +513,7 @@ pub use std_detect::detect;
// Re-export macros defined in libcore.
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated_in_future)]
#[allow(deprecated, deprecated_in_future)]
pub use core::{
// Stable
assert_eq,
@ -531,7 +531,6 @@ pub use core::{
};
// Re-export built-in macros defined through libcore.
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
pub use core::{
// Stable

View file

@ -8,8 +8,7 @@
#![stable(feature = "raw_os", since = "1.1.0")]
#[cfg_attr(bootstrap, doc(include = "os/raw/char.md"))]
#[cfg_attr(not(bootstrap), doc(include = "char.md"))]
#[doc(include = "char.md")]
#[cfg(any(all(target_os = "linux", any(target_arch = "aarch64",
target_arch = "arm",
target_arch = "hexagon",
@ -33,8 +32,7 @@
target_arch = "powerpc")),
all(target_os = "fuchsia", target_arch = "aarch64")))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
#[cfg_attr(bootstrap, doc(include = "os/raw/char.md"))]
#[cfg_attr(not(bootstrap), doc(include = "char.md"))]
#[doc(include = "char.md")]
#[cfg(not(any(all(target_os = "linux", any(target_arch = "aarch64",
target_arch = "arm",
target_arch = "hexagon",
@ -58,51 +56,37 @@
target_arch = "powerpc")),
all(target_os = "fuchsia", target_arch = "aarch64"))))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = i8;
#[cfg_attr(bootstrap, doc(include = "os/raw/schar.md"))]
#[cfg_attr(not(bootstrap), doc(include = "schar.md"))]
#[doc(include = "schar.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_schar = i8;
#[cfg_attr(bootstrap, doc(include = "os/raw/uchar.md"))]
#[cfg_attr(not(bootstrap), doc(include = "uchar.md"))]
#[doc(include = "uchar.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_uchar = u8;
#[cfg_attr(bootstrap, doc(include = "os/raw/short.md"))]
#[cfg_attr(not(bootstrap), doc(include = "short.md"))]
#[doc(include = "short.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_short = i16;
#[cfg_attr(bootstrap, doc(include = "os/raw/ushort.md"))]
#[cfg_attr(not(bootstrap), doc(include = "ushort.md"))]
#[doc(include = "ushort.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ushort = u16;
#[cfg_attr(bootstrap, doc(include = "os/raw/int.md"))]
#[cfg_attr(not(bootstrap), doc(include = "int.md"))]
#[doc(include = "int.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_int = i32;
#[cfg_attr(bootstrap, doc(include = "os/raw/uint.md"))]
#[cfg_attr(not(bootstrap), doc(include = "uint.md"))]
#[doc(include = "uint.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_uint = u32;
#[cfg_attr(bootstrap, doc(include = "os/raw/long.md"))]
#[cfg_attr(not(bootstrap), doc(include = "long.md"))]
#[doc(include = "long.md")]
#[cfg(any(target_pointer_width = "32", windows))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_long = i32;
#[cfg_attr(bootstrap, doc(include = "os/raw/ulong.md"))]
#[cfg_attr(not(bootstrap), doc(include = "ulong.md"))]
#[doc(include = "ulong.md")]
#[cfg(any(target_pointer_width = "32", windows))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulong = u32;
#[cfg_attr(bootstrap, doc(include = "os/raw/long.md"))]
#[cfg_attr(not(bootstrap), doc(include = "long.md"))]
#[doc(include = "long.md")]
#[cfg(all(target_pointer_width = "64", not(windows)))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_long = i64;
#[cfg_attr(bootstrap, doc(include = "os/raw/ulong.md"))]
#[cfg_attr(not(bootstrap), doc(include = "ulong.md"))]
#[doc(include = "ulong.md")]
#[cfg(all(target_pointer_width = "64", not(windows)))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulong = u64;
#[cfg_attr(bootstrap, doc(include = "os/raw/longlong.md"))]
#[cfg_attr(not(bootstrap), doc(include = "longlong.md"))]
#[doc(include = "longlong.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_longlong = i64;
#[cfg_attr(bootstrap, doc(include = "os/raw/ulonglong.md"))]
#[cfg_attr(not(bootstrap), doc(include = "ulonglong.md"))]
#[doc(include = "ulonglong.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_ulonglong = u64;
#[cfg_attr(bootstrap, doc(include = "os/raw/float.md"))]
#[cfg_attr(not(bootstrap), doc(include = "float.md"))]
#[doc(include = "float.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_float = f32;
#[cfg_attr(bootstrap, doc(include = "os/raw/double.md"))]
#[cfg_attr(not(bootstrap), doc(include = "double.md"))]
#[doc(include = "double.md")]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_double = f64;
#[stable(feature = "raw_os", since = "1.1.0")]

View file

@ -7,10 +7,6 @@
#![stable(feature = "rust1", since = "1.0.0")]
// Re-exported core operators
#[cfg(bootstrap)]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::marker::Copy;
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::marker::{Send, Sized, Sync, Unpin};
@ -24,21 +20,9 @@ pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
pub use crate::mem::drop;
// Re-exported types and traits
#[cfg(bootstrap)]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::clone::Clone;
#[cfg(bootstrap)]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::cmp::{PartialEq, PartialOrd, Eq, Ord};
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::convert::{AsRef, AsMut, Into, From};
#[cfg(bootstrap)]
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::default::Default;
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)]
pub use crate::iter::{Iterator, Extend, IntoIterator};
@ -53,7 +37,6 @@ pub use crate::option::Option::{self, Some, None};
pub use crate::result::Result::{self, Ok, Err};
// Re-exported built-in macros
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(no_inline)]
pub use core::prelude::v1::{
@ -83,7 +66,6 @@ pub use core::prelude::v1::{
// FIXME: Attribute and derive macros are not documented because for them rustdoc generates
// dead links which fail link checker testing.
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow(deprecated)]
#[doc(hidden)]

View file

@ -163,7 +163,6 @@ pub use self::condvar::{Condvar, WaitTimeoutResult};
#[stable(feature = "rust1", since = "1.0.0")]
pub use self::mutex::{Mutex, MutexGuard};
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
#[allow(deprecated)]
pub use self::once::{Once, OnceState, ONCE_INIT};
#[stable(feature = "rust1", since = "1.0.0")]

View file

@ -1,4 +1,4 @@
#![allow(deprecated_in_future)] // mem::uninitialized; becomes `deprecated` when nightly is 1.39
#![allow(deprecated)] // mem::uninitialized
use crate::io::ErrorKind;
use crate::mem;

View file

@ -4,13 +4,11 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");
let target = env::var("TARGET").expect("TARGET was not set");
// FIXME: the not(bootstrap) part is needed because of the issue addressed by #62286,
// and could be removed once that change is in beta.
if cfg!(all(not(bootstrap), feature = "llvm-libunwind")) &&
if cfg!(feature = "llvm-libunwind") &&
(target.contains("linux") ||
target.contains("fuchsia")) {
// Build the unwinding from libunwind C/C++ source code.
#[cfg(all(not(bootstrap), feature = "llvm-libunwind"))]
#[cfg(feature = "llvm-libunwind")]
llvm_libunwind::compile();
} else if target.contains("linux") {
if target.contains("musl") {
@ -46,7 +44,7 @@ fn main() {
}
}
#[cfg(all(not(bootstrap), feature = "llvm-libunwind"))]
#[cfg(feature = "llvm-libunwind")]
mod llvm_libunwind {
use std::env;
use std::path::Path;

View file

@ -70,7 +70,7 @@ pub enum _Unwind_Context {}
pub type _Unwind_Exception_Cleanup_Fn = extern "C" fn(unwind_code: _Unwind_Reason_Code,
exception: *mut _Unwind_Exception);
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind",
#[cfg_attr(all(feature = "llvm-libunwind",
any(target_os = "fuchsia", target_os = "linux")),
link(name = "unwind", kind = "static"))]
extern "C" {
@ -97,7 +97,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm
}
pub use _Unwind_Action::*;
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind",
#[cfg_attr(all(feature = "llvm-libunwind",
any(target_os = "fuchsia", target_os = "linux")),
link(name = "unwind", kind = "static"))]
extern "C" {
@ -153,7 +153,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm
pub const UNWIND_POINTER_REG: c_int = 12;
pub const UNWIND_IP_REG: c_int = 15;
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind",
#[cfg_attr(all(feature = "llvm-libunwind",
any(target_os = "fuchsia", target_os = "linux")),
link(name = "unwind", kind = "static"))]
extern "C" {
@ -218,7 +218,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm
cfg_if::cfg_if! {
if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
// Not 32-bit iOS
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind",
#[cfg_attr(all(feature = "llvm-libunwind",
any(target_os = "fuchsia", target_os = "linux")),
link(name = "unwind", kind = "static"))]
extern "C" {
@ -230,7 +230,7 @@ if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
}
} else {
// 32-bit iOS uses SjLj and does not provide _Unwind_Backtrace()
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind",
#[cfg_attr(all(feature = "llvm-libunwind",
any(target_os = "fuchsia", target_os = "linux")),
link(name = "unwind", kind = "static"))]
extern "C" {

View file

@ -1,5 +1,5 @@
#![deny(unused_qualifications)]
#[allow(deprecated)]
#![allow(deprecated)]
mod foo {
pub fn bar() {}