Skip to content

Commit

Permalink
Bump stage0 compiler to 1.56
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Sep 9, 2021
1 parent 97032a6 commit b4e7649
Show file tree
Hide file tree
Showing 29 changed files with 344 additions and 430 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_ast/src/lib.rs
Expand Up @@ -9,14 +9,12 @@
test(attr(deny(warnings)))
)]
#![feature(box_patterns)]
#![cfg_attr(bootstrap, feature(const_fn_transmute))]
#![feature(crate_visibility_modifier)]
#![feature(if_let_guard)]
#![feature(iter_zip)]
#![feature(label_break_value)]
#![feature(nll)]
#![feature(min_specialization)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
#![recursion_limit = "256"]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_ast_passes/src/lib.rs
Expand Up @@ -4,7 +4,6 @@
//!
//! The crate also contains other misc AST visitors, e.g. `node_count` and `show_span`.

#![cfg_attr(bootstrap, feature(bindings_after_at))]
#![feature(iter_is_partitioned)]
#![feature(box_patterns)]
#![recursion_limit = "256"]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_const_eval/src/lib.rs
Expand Up @@ -5,7 +5,6 @@ Rust MIR: a lowered representation of Rust.
*/

#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(bindings_after_at))]
#![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(control_flow_enum)]
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_data_structures/src/lib.rs
Expand Up @@ -21,8 +21,7 @@
#![feature(iter_map_while)]
#![feature(maybe_uninit_uninit_array)]
#![feature(min_specialization)]
#![cfg_attr(bootstrap, feature(min_type_alias_impl_trait))]
#![cfg_attr(not(bootstrap), feature(type_alias_impl_trait))]
#![feature(type_alias_impl_trait)]
#![feature(new_uninit)]
#![feature(nll)]
#![feature(once_cell)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_errors/src/lib.rs
Expand Up @@ -9,7 +9,6 @@
#![feature(format_args_capture)]
#![feature(iter_zip)]
#![feature(nll)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_expand/src/lib.rs
@@ -1,4 +1,3 @@
#![cfg_attr(bootstrap, feature(bindings_after_at))]
#![feature(crate_visibility_modifier)]
#![feature(decl_macro)]
#![feature(destructuring_assignment)]
Expand All @@ -9,7 +8,6 @@
#![feature(proc_macro_internals)]
#![feature(proc_macro_span)]
#![feature(try_blocks)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
#![recursion_limit = "256"]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/lib.rs
Expand Up @@ -56,7 +56,6 @@
#![feature(try_reserve)]
#![feature(try_reserve_kind)]
#![feature(nonzero_ops)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
#![recursion_limit = "512"]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_mir_transform/src/lib.rs
@@ -1,4 +1,3 @@
#![cfg_attr(bootstrap, feature(bindings_after_at))]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(crate_visibility_modifier)]
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_parse/src/lib.rs
Expand Up @@ -3,9 +3,7 @@
#![feature(array_windows)]
#![feature(crate_visibility_modifier)]
#![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(bindings_after_at))]
#![feature(box_patterns)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
#![recursion_limit = "256"]

use rustc_ast as ast;
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_save_analysis/src/lib.rs
@@ -1,7 +1,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(if_let_guard)]
#![feature(nll)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
#![recursion_limit = "256"]

mod dump_visitor;
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/lib.rs
Expand Up @@ -21,7 +21,6 @@
#![feature(nll)]
#![feature(min_specialization)]
#![feature(thread_local_const_init)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_typeck/src/lib.rs
Expand Up @@ -56,7 +56,6 @@ This API is completely unstable and subject to change.
*/

#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![cfg_attr(bootstrap, feature(bindings_after_at))]
#![feature(bool_to_option)]
#![feature(crate_visibility_modifier)]
#![feature(format_args_capture)]
Expand All @@ -69,7 +68,6 @@ This API is completely unstable and subject to change.
#![feature(never_type)]
#![feature(slice_partition_dedup)]
#![feature(control_flow_enum)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
#![recursion_limit = "256"]

#[macro_use]
Expand Down
3 changes: 0 additions & 3 deletions library/alloc/src/lib.rs
Expand Up @@ -85,7 +85,6 @@
#![feature(allow_internal_unstable)]
#![feature(arbitrary_self_types)]
#![feature(async_stream)]
#![cfg_attr(bootstrap, feature(bindings_after_at))]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(cfg_sanitize)]
Expand Down Expand Up @@ -143,8 +142,6 @@
#![feature(alloc_layout_extra)]
#![feature(trusted_random_access)]
#![feature(try_trait_v2)]
#![cfg_attr(bootstrap, feature(min_type_alias_impl_trait))]
#![cfg_attr(not(bootstrap), feature(type_alias_impl_trait))]
#![feature(associated_type_bounds)]
#![feature(slice_group_by)]
#![feature(decl_macro)]
Expand Down
25 changes: 0 additions & 25 deletions library/core/src/fmt/mod.rs
Expand Up @@ -333,7 +333,6 @@ enum FlagV1 {
impl<'a> Arguments<'a> {
/// When using the format_args!() macro, this function is used to generate the
/// Arguments structure.
#[cfg(not(bootstrap))]
#[doc(hidden)]
#[inline]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
Expand All @@ -347,25 +346,13 @@ impl<'a> Arguments<'a> {
}
Arguments { pieces, fmt: None, args }
}
#[cfg(bootstrap)]
#[doc(hidden)]
#[inline]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
#[rustc_const_unstable(feature = "const_fmt_arguments_new", issue = "none")]
pub const fn new_v1(pieces: &'a [&'static str], args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
if pieces.len() < args.len() || pieces.len() > args.len() + 1 {
panic!("invalid args");
}
Arguments { pieces, fmt: None, args }
}

/// This function is used to specify nonstandard formatting parameters.
/// The `pieces` array must be at least as long as `fmt` to construct
/// a valid Arguments structure. Also, any `Count` within `fmt` that is
/// `CountIsParam` or `CountIsNextParam` has to point to an argument
/// created with `argumentusize`. However, failing to do so doesn't cause
/// unsafety, but will ignore invalid .
#[cfg(not(bootstrap))]
#[doc(hidden)]
#[inline]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
Expand All @@ -377,18 +364,6 @@ impl<'a> Arguments<'a> {
) -> Arguments<'a> {
Arguments { pieces, fmt: Some(fmt), args }
}
#[cfg(bootstrap)]
#[doc(hidden)]
#[inline]
#[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
#[rustc_const_unstable(feature = "const_fmt_arguments_new", issue = "none")]
pub const fn new_v1_formatted(
pieces: &'a [&'static str],
args: &'a [ArgumentV1<'a>],
fmt: &'a [rt::v1::Argument],
) -> Arguments<'a> {
Arguments { pieces, fmt: Some(fmt), args }
}

/// Estimates the length of the formatted text.
///
Expand Down
16 changes: 2 additions & 14 deletions library/core/src/hint.rs
Expand Up @@ -154,18 +154,6 @@ pub fn spin_loop() {
/// [`std::convert::identity`]: crate::convert::identity
#[inline]
#[unstable(feature = "bench_black_box", issue = "64102")]
#[cfg_attr(not(bootstrap), allow(unused_mut))]
#[cfg_attr(bootstrap, allow(deprecated))]
pub fn black_box<T>(mut dummy: T) -> T {
#[cfg(bootstrap)]
// SAFETY: the inline assembly is a no-op.
unsafe {
llvm_asm!("" : : "r"(&mut dummy) : "memory" : "volatile");
dummy
}

#[cfg(not(bootstrap))]
{
crate::intrinsics::black_box(dummy)
}
pub fn black_box<T>(dummy: T) -> T {
crate::intrinsics::black_box(dummy)
}
1 change: 0 additions & 1 deletion library/core/src/intrinsics.rs
Expand Up @@ -1937,7 +1937,6 @@ extern "rust-intrinsic" {
/// See documentation of [`std::hint::black_box`] for details.
///
/// [`std::hint::black_box`]: crate::hint::black_box
#[cfg(not(bootstrap))]
pub fn black_box<T>(dummy: T) -> T;
}

Expand Down
3 changes: 0 additions & 3 deletions library/core/src/lib.rs
Expand Up @@ -69,7 +69,6 @@
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
#![allow(explicit_outlives_requirements)]
#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
//
// Library features for const fns:
#![feature(const_align_of_val)]
Expand Down Expand Up @@ -122,8 +121,6 @@
#![feature(const_fn_floating_point_arithmetic)]
#![feature(const_fn_fn_ptr_basics)]
#![feature(const_fn_trait_bound)]
#![cfg_attr(bootstrap, feature(const_fn_transmute))]
#![cfg_attr(bootstrap, feature(const_fn_union))]
#![feature(const_impl_trait)]
#![feature(const_mut_refs)]
#![feature(const_panic)]
Expand Down
11 changes: 0 additions & 11 deletions library/core/src/macros/mod.rs
Expand Up @@ -842,7 +842,6 @@ pub(crate) mod builtin {
/// This macro is used by the panic macros for the `const_panic` feature.
///
/// This macro will be removed once `format_args` is allowed in const contexts.
#[cfg(not(bootstrap))]
#[unstable(feature = "const_format_args", issue = "none")]
#[allow_internal_unstable(fmt_internals, const_fmt_arguments_new)]
#[rustc_builtin_macro]
Expand All @@ -852,16 +851,6 @@ pub(crate) mod builtin {
($fmt:expr, $($args:tt)*) => {{ /* compiler built-in */ }};
}

/// Same as `format_args`, but can be used in some const contexts.
#[cfg(bootstrap)]
#[unstable(feature = "const_format_args", issue = "none")]
#[macro_export]
macro_rules! const_format_args {
($($t:tt)*) => {
$crate::format_args!($($t)*)
}
}

/// Same as `format_args`, but adds a newline in the end.
#[unstable(
feature = "format_args_nl",
Expand Down
2 changes: 0 additions & 2 deletions library/core/src/num/int_macros.rs
Expand Up @@ -2350,7 +2350,6 @@ macro_rules! int_impl {
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always
// transmute them to arrays of bytes
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
#[inline]
pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
// SAFETY: integers are plain old datatypes so we can always transmute them to
Expand Down Expand Up @@ -2456,7 +2455,6 @@ macro_rules! int_impl {
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always
// transmute to them
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
#[inline]
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
// SAFETY: integers are plain old datatypes so we can always transmute to them
Expand Down
2 changes: 0 additions & 2 deletions library/core/src/num/uint_macros.rs
Expand Up @@ -2119,7 +2119,6 @@ macro_rules! uint_impl {
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always
// transmute them to arrays of bytes
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
#[inline]
pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
// SAFETY: integers are plain old datatypes so we can always transmute them to
Expand Down Expand Up @@ -2225,7 +2224,6 @@ macro_rules! uint_impl {
#[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
// SAFETY: const sound because integers are plain old datatypes so we can always
// transmute to them
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
#[inline]
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
// SAFETY: integers are plain old datatypes so we can always transmute to them
Expand Down
10 changes: 2 additions & 8 deletions library/core/src/panicking.rs
Expand Up @@ -48,13 +48,8 @@ pub fn panic(expr: &'static str) -> ! {
// Arguments::new_v1 may allow the compiler to omit Formatter::pad from the
// output binary, saving up to a few kilobytes.
panic_fmt(
#[cfg(bootstrap)]
fmt::Arguments::new_v1(&[expr], &[]),
#[cfg(not(bootstrap))]
// SAFETY: Arguments::new_v1 is safe with exactly one str and zero args
unsafe {
fmt::Arguments::new_v1(&[expr], &[])
},
unsafe { fmt::Arguments::new_v1(&[expr], &[]) },
);
}

Expand Down Expand Up @@ -82,7 +77,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
#[cfg_attr(feature = "panic_immediate_abort", inline)]
#[track_caller]
#[cfg_attr(not(bootstrap), lang = "panic_fmt")] // needed for const-evaluated panics
#[lang = "panic_fmt"] // needed for const-evaluated panics
pub fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
if cfg!(feature = "panic_immediate_abort") {
super::intrinsics::abort()
Expand All @@ -102,7 +97,6 @@ pub fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
}

/// This function is used instead of panic_fmt in const eval.
#[cfg(not(bootstrap))]
#[lang = "const_panic_fmt"]
pub const fn const_panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
if let Some(msg) = fmt.as_str() {
Expand Down
1 change: 0 additions & 1 deletion library/core/src/slice/mod.rs
Expand Up @@ -98,7 +98,6 @@ impl<T> [T] {
#[rustc_const_stable(feature = "const_slice_len", since = "1.39.0")]
#[inline]
// SAFETY: const sound because we transmute out the length field as a usize (which it must be)
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_union))]
pub const fn len(&self) -> usize {
// FIXME: Replace with `crate::ptr::metadata(self)` when that is const-stable.
// As of this writing this causes a "Const-stable functions can only call other
Expand Down
1 change: 0 additions & 1 deletion library/core/src/str/converts.rs
Expand Up @@ -157,7 +157,6 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_str_from_utf8_unchecked", since = "1.55.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
// SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
// Also relies on `&str` and `&[u8]` having the same layout.
Expand Down
1 change: 0 additions & 1 deletion library/core/src/str/mod.rs
Expand Up @@ -231,7 +231,6 @@ impl str {
#[rustc_const_stable(feature = "str_as_bytes", since = "1.39.0")]
#[inline(always)]
#[allow(unused_attributes)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
pub const fn as_bytes(&self) -> &[u8] {
// SAFETY: const sound because we transmute two types with the same layout
unsafe { mem::transmute(self) }
Expand Down
3 changes: 1 addition & 2 deletions library/std/src/lib.rs
Expand Up @@ -247,7 +247,6 @@
#![feature(const_cstr_unchecked)]
#![feature(const_fn_floating_point_arithmetic)]
#![feature(const_fn_fn_ptr_basics)]
#![cfg_attr(bootstrap, feature(const_fn_transmute))]
#![feature(const_format_args)]
#![feature(const_io_structs)]
#![feature(const_ip)]
Expand All @@ -265,7 +264,7 @@
#![feature(doc_keyword)]
#![feature(doc_masked)]
#![feature(doc_notable_trait)]
#![cfg_attr(not(bootstrap), feature(doc_primitive))]
#![feature(doc_primitive)]
#![feature(dropck_eyepatch)]
#![feature(duration_checked_float)]
#![feature(duration_constants)]
Expand Down
2 changes: 0 additions & 2 deletions library/std/src/net/ip.rs
Expand Up @@ -1166,7 +1166,6 @@ impl Ipv6Addr {
///
/// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
/// ```
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
#[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")]
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand Down Expand Up @@ -1228,7 +1227,6 @@ impl Ipv6Addr {
/// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).segments(),
/// [0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff]);
/// ```
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_fn_transmute))]
#[rustc_const_stable(feature = "const_ipv6", since = "1.50.0")]
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/panicking.rs
Expand Up @@ -450,7 +450,7 @@ pub fn panicking() -> bool {
#[cfg_attr(not(feature = "panic_immediate_abort"), track_caller)]
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
#[cfg_attr(feature = "panic_immediate_abort", inline)]
#[cfg_attr(all(not(bootstrap), not(test)), lang = "begin_panic_fmt")]
#[cfg_attr(not(test), lang = "begin_panic_fmt")]
pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>) -> ! {
if cfg!(feature = "panic_immediate_abort") {
intrinsics::abort()
Expand Down
3 changes: 1 addition & 2 deletions library/std/src/primitive_docs.rs
Expand Up @@ -615,8 +615,7 @@ mod prim_pointer {}
/// Starting in the 2021 edition, `array.into_iter()` uses `IntoIterator` normally to iterate
/// by value, and `iter()` should be used to iterate by reference like previous editions.
///
#[cfg_attr(bootstrap, doc = "```rust,edition2021,ignore")]
#[cfg_attr(not(bootstrap), doc = "```rust,edition2021")]
/// ```rust,edition2021
/// // Rust 2021:
///
/// let array: [i32; 3] = [0; 3];
Expand Down

0 comments on commit b4e7649

Please sign in to comment.