Skip to content

Commit

Permalink
Auto merge of #120676 - Mark-Simulacrum:bootstrap-bump, r=clubby789
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Feb 9, 2024
2 parents e28fae5 + 9a5034a commit f4cfd87
Show file tree
Hide file tree
Showing 41 changed files with 485 additions and 618 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ declare_features! (
/// Allows empty structs and enum variants with braces.
(accepted, braced_empty_structs, "1.8.0", Some(29720)),
/// Allows `c"foo"` literals.
(accepted, c_str_literals, "CURRENT_RUSTC_VERSION", Some(105723)),
(accepted, c_str_literals, "1.77.0", Some(105723)),
/// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`.
(accepted, cfg_attr_multi, "1.33.0", Some(54881)),
/// Allows the use of `#[cfg(doctest)]`, set when rustdoc is collecting doctests.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare_features! (
// -------------------------------------------------------------------------

/// Allows using the `amdgpu-kernel` ABI.
(removed, abi_amdgpu_kernel, "CURRENT_RUSTC_VERSION", Some(51575), None),
(removed, abi_amdgpu_kernel, "1.77.0", Some(51575), None),
(removed, advanced_slice_patterns, "1.0.0", Some(62254),
Some("merged into `#![feature(slice_patterns)]`")),
(removed, allocator, "1.0.0", None, None),
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ declare_features! (
/// Allows `#[track_caller]` on async functions.
(unstable, async_fn_track_caller, "1.73.0", Some(110011)),
/// Allows `for await` loops.
(unstable, async_for_loop, "CURRENT_RUSTC_VERSION", Some(118898)),
(unstable, async_for_loop, "1.77.0", Some(118898)),
/// Allows builtin # foo() syntax
(unstable, builtin_syntax, "1.71.0", Some(110680)),
/// Treat `extern "C"` function as nounwind.
Expand All @@ -370,7 +370,7 @@ declare_features! (
/// Allows the use of `#[cfg(sanitize = "option")]`; set when -Zsanitizer is used.
(unstable, cfg_sanitize, "1.41.0", Some(39699)),
/// Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`.
(unstable, cfg_sanitizer_cfi, "CURRENT_RUSTC_VERSION", Some(89653)),
(unstable, cfg_sanitizer_cfi, "1.77.0", Some(89653)),
/// Allows `cfg(target_abi = "...")`.
(unstable, cfg_target_abi, "1.55.0", Some(80970)),
/// Allows `cfg(target(abi = "..."))`.
Expand Down Expand Up @@ -514,7 +514,7 @@ declare_features! (
(unstable, marker_trait_attr, "1.30.0", Some(29864)),
/// Allows exhaustive pattern matching on types that contain uninhabited types in cases that are
/// unambiguously sound.
(incomplete, min_exhaustive_patterns, "CURRENT_RUSTC_VERSION", Some(119612)),
(incomplete, min_exhaustive_patterns, "1.77.0", Some(119612)),
/// A minimal, sound subset of specialization intended to be used by the
/// standard library until the soundness issues with specialization
/// are fixed.
Expand Down Expand Up @@ -550,7 +550,7 @@ declare_features! (
/// Allows using enums in offset_of!
(unstable, offset_of_enum, "1.75.0", Some(120141)),
/// Allows using multiple nested field accesses in offset_of!
(unstable, offset_of_nested, "CURRENT_RUSTC_VERSION", Some(120140)),
(unstable, offset_of_nested, "1.77.0", Some(120140)),
/// Allows using `#[optimize(X)]`.
(unstable, optimize_attribute, "1.34.0", Some(54882)),
/// Allows macro attributes on expressions, statements and non-inline modules.
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_index_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ mod newtype;
/// - `#[max = 0xFFFF_FFFD]`: specifies the max value, which allows niche
/// optimizations. The default max value is 0xFFFF_FF00.
/// - `#[gate_rustc_only]`: makes parts of the generated code nightly-only.
///
/// `SpecOptionPartialEq` is specialized by this macro, so using it requires enabling
/// `#![feature(min_specialization)]` for the crate.
#[proc_macro]
#[cfg_attr(
feature = "nightly",
allow_internal_unstable(step_trait, rustc_attrs, trusted_step, spec_option_partial_eq)
allow_internal_unstable(
step_trait,
rustc_attrs,
trusted_step,
spec_option_partial_eq,
min_specialization
)
)]
// FIXME: Remove the above comment about `min_specialization` once bootstrap is bumped,
// and the corresponding one on SpecOptionPartialEq
#[cfg_attr(all(feature = "nightly", not(bootstrap)), allow_internal_unstable(min_specialization))]
pub fn newtype_index(input: TokenStream) -> TokenStream {
newtype::newtype(input)
}
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#![feature(if_let_guard)]
#![feature(iter_order_by)]
#![feature(let_chains)]
#![cfg_attr(not(bootstrap), feature(trait_upcasting))]
#![feature(trait_upcasting)]
#![feature(min_specialization)]
#![feature(rustc_attrs)]
#![allow(internal_features)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#![feature(associated_type_bounds)]
#![feature(rustc_attrs)]
#![feature(control_flow_enum)]
#![cfg_attr(not(bootstrap), feature(trait_upcasting))]
#![feature(trait_upcasting)]
#![feature(try_blocks)]
#![feature(decl_macro)]
#![feature(extract_if)]
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub use core::slice::{from_mut, from_ref};
pub use core::slice::{from_mut_ptr_range, from_ptr_range};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
#[stable(feature = "slice_group_by", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "slice_group_by", since = "1.77.0")]
pub use core::slice::{ChunkBy, ChunkByMut};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::slice::{Chunks, Windows};
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/vec/cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<'a, T: Clone> From<&'a [T]> for Cow<'a, [T]> {
}
}

#[stable(feature = "cow_from_array_ref", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "cow_from_array_ref", since = "1.77.0")]
impl<'a, T: Clone, const N: usize> From<&'a [T; N]> for Cow<'a, [T]> {
/// Creates a [`Borrowed`] variant of [`Cow`]
/// from a reference to an array.
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ impl<T, const N: usize> [T; N] {
/// // We can still access the original array: it has not been moved.
/// assert_eq!(strings.len(), 3);
/// ```
#[stable(feature = "array_methods", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "array_methods", since = "1.77.0")]
pub fn each_ref(&self) -> [&T; N] {
from_trusted_iterator(self.iter())
}
Expand All @@ -595,7 +595,7 @@ impl<T, const N: usize> [T; N] {
/// assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);
/// assert_eq!(floats, [0.0, 2.7, -1.0]);
/// ```
#[stable(feature = "array_methods", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "array_methods", since = "1.77.0")]
pub fn each_mut(&mut self) -> [&mut T; N] {
from_trusted_iterator(self.iter_mut())
}
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/async_iter/async_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub trait AsyncIterator {
/// Rust's usual rules apply: calls must never cause undefined behavior
/// (memory corruption, incorrect use of `unsafe` functions, or the like),
/// regardless of the async iterator's state.
#[cfg_attr(not(bootstrap), lang = "async_iterator_poll_next")]
#[lang = "async_iterator_poll_next"]
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>;

/// Returns the bounds on the remaining length of the async iterator.
Expand Down Expand Up @@ -145,7 +145,7 @@ pub trait IntoAsyncIterator {
type IntoAsyncIter: AsyncIterator<Item = Self::Item>;

/// Converts `self` into an async iterator
#[cfg_attr(not(bootstrap), lang = "into_async_iter_into_iter")]
#[lang = "into_async_iter_into_iter"]
fn into_async_iter(self) -> Self::IntoAsyncIter;
}

Expand Down
11 changes: 1 addition & 10 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ extern "rust-intrinsic" {
/// own, or if it does not enable any significant optimizations.
///
/// This intrinsic does not have a stable counterpart.
#[rustc_const_stable(feature = "const_assume", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_assume", since = "1.77.0")]
#[rustc_nounwind]
pub fn assume(b: bool);

Expand Down Expand Up @@ -2567,7 +2567,6 @@ extern "rust-intrinsic" {
/// matter what*.
#[rustc_const_unstable(feature = "is_val_statically_known", issue = "none")]
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn is_val_statically_known<T: Copy>(arg: T) -> bool;

#[rustc_const_unstable(feature = "delayed_debug_assertions", issue = "none")]
Expand All @@ -2582,14 +2581,6 @@ pub(crate) const fn debug_assertions() -> bool {
cfg!(debug_assertions)
}

// FIXME: Seems using `unstable` here completely ignores `rustc_allow_const_fn_unstable`
// and thus compiling stage0 core doesn't work.
#[rustc_const_stable(feature = "is_val_statically_known", since = "0.0.0")]
#[cfg(bootstrap)]
pub const unsafe fn is_val_statically_known<T: Copy>(_arg: T) -> bool {
false
}

// Some functions are defined here because they accidentally got made
// available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>.
// (`transmute` also falls into this category, but it cannot be wrapped due to the
Expand Down
2 changes: 0 additions & 2 deletions library/core/src/intrinsics/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
//! }
//!
//! #[custom_mir(dialect = "runtime", phase = "optimized")]
#![cfg_attr(bootstrap, doc = "#[cfg(any())]")] // disable the following function in doctests when `bootstrap` is set
//! fn push_and_pop<T>(v: &mut Vec<T>, value: T) {
//! mir!(
//! let _unused;
Expand Down Expand Up @@ -357,7 +356,6 @@ define!("mir_unwind_resume",

define!("mir_storage_live", fn StorageLive<T>(local: T));
define!("mir_storage_dead", fn StorageDead<T>(local: T));
#[cfg(not(bootstrap))]
define!("mir_assume", fn Assume(operand: bool));
define!("mir_deinit", fn Deinit<T>(place: T));
define!("mir_checked", fn Checked<T>(binop: T) -> (T, bool));
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
//
// Library features:
// tidy-alphabetical-start
#![cfg_attr(not(bootstrap), feature(offset_of_nested))]
#![feature(char_indices_offset)]
#![feature(const_align_of_val)]
#![feature(const_align_of_val_raw)]
Expand Down Expand Up @@ -181,6 +180,7 @@
#![feature(maybe_uninit_uninit_array)]
#![feature(non_null_convenience)]
#![feature(offset_of_enum)]
#![feature(offset_of_nested)]
#![feature(panic_internals)]
#![feature(ptr_alignment_type)]
#![feature(ptr_metadata)]
Expand Down
89 changes: 0 additions & 89 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,77 +225,6 @@ marker_impls! {
{T: ?Sized} &T,
}

/// Required trait for constants used in pattern matches.
///
/// Any type that derives `Eq` automatically implements this trait, *regardless*
/// of whether its type parameters implement `Eq`.
///
/// This is a hack to work around a limitation in our type system.
///
/// # Background
///
/// We want to require that types of consts used in pattern matches
/// have the attribute `#[derive(PartialEq, Eq)]`.
///
/// In a more ideal world, we could check that requirement by just checking that
/// the given type implements both the `StructuralPartialEq` trait *and*
/// the `Eq` trait. However, you can have ADTs that *do* `derive(PartialEq, Eq)`,
/// and be a case that we want the compiler to accept, and yet the constant's
/// type fails to implement `Eq`.
///
/// Namely, a case like this:
///
/// ```rust
/// #[derive(PartialEq, Eq)]
/// struct Wrap<X>(X);
///
/// fn higher_order(_: &()) { }
///
/// const CFN: Wrap<fn(&())> = Wrap(higher_order);
///
/// #[allow(pointer_structural_match)]
/// fn main() {
/// match CFN {
/// CFN => {}
/// _ => {}
/// }
/// }
/// ```
///
/// (The problem in the above code is that `Wrap<fn(&())>` does not implement
/// `PartialEq`, nor `Eq`, because `for<'a> fn(&'a _)` does not implement those
/// traits.)
///
/// Therefore, we cannot rely on naive check for `StructuralPartialEq` and
/// mere `Eq`.
///
/// As a hack to work around this, we use two separate traits injected by each
/// of the two derives (`#[derive(PartialEq)]` and `#[derive(Eq)]`) and check
/// that both of them are present as part of structural-match checking.
#[unstable(feature = "structural_match", issue = "31434")]
#[diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(Eq)]`")]
#[lang = "structural_teq"]
#[cfg(bootstrap)]
pub trait StructuralEq {
// Empty.
}

// FIXME: Remove special cases of these types from the compiler pattern checking code and always check `T: StructuralEq` instead
marker_impls! {
#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(bootstrap)]
StructuralEq for
usize, u8, u16, u32, u64, u128,
isize, i8, i16, i32, i64, i128,
bool,
char,
str /* Technically requires `[u8]: StructuralEq` */,
(),
{T, const N: usize} [T; N],
{T} [T],
{T: ?Sized} &T,
}

/// Types whose values can be duplicated simply by copying bits.
///
/// By default, variable bindings have 'move semantics.' In other
Expand Down Expand Up @@ -860,10 +789,6 @@ impl<T: ?Sized> Default for PhantomData<T> {
#[unstable(feature = "structural_match", issue = "31434")]
impl<T: ?Sized> StructuralPartialEq for PhantomData<T> {}

#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(bootstrap)]
impl<T: ?Sized> StructuralEq for PhantomData<T> {}

/// Compiler-internal trait used to indicate the type of enum discriminants.
///
/// This trait is automatically implemented for every type and does not add any
Expand Down Expand Up @@ -1041,22 +966,8 @@ pub trait PointerLike {}
#[unstable(feature = "adt_const_params", issue = "95174")]
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
#[allow(multiple_supertrait_upcastable)]
#[cfg(not(bootstrap))]
pub trait ConstParamTy: StructuralPartialEq + Eq {}

/// A marker for types which can be used as types of `const` generic parameters.
///
/// These types must have a proper equivalence relation (`Eq`) and it must be automatically
/// derived (`StructuralPartialEq`). There's a hard-coded check in the compiler ensuring
/// that all fields are also `ConstParamTy`, which implies that recursively, all fields
/// are `StructuralPartialEq`.
#[lang = "const_param_ty"]
#[unstable(feature = "adt_const_params", issue = "95174")]
#[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
#[allow(multiple_supertrait_upcastable)]
#[cfg(bootstrap)]
pub trait ConstParamTy: StructuralEq + StructuralPartialEq + Eq {}

/// Derive macro generating an impl of the trait `ConstParamTy`.
#[rustc_builtin_macro]
#[unstable(feature = "adt_const_params", issue = "95174")]
Expand Down
12 changes: 1 addition & 11 deletions library/core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1393,19 +1393,9 @@ impl<T> SizedTypeProperties for T {}
///
/// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
/// ```
#[cfg(not(bootstrap))]
#[stable(feature = "offset_of", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "offset_of", since = "1.77.0")]
#[allow_internal_unstable(builtin_syntax, hint_must_use)]
pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) {
// The `{}` is for better error messages
crate::hint::must_use({builtin # offset_of($Container, $($fields)+)})
}

#[cfg(bootstrap)]
#[stable(feature = "offset_of", since = "CURRENT_RUSTC_VERSION")]
#[allow_internal_unstable(builtin_syntax, hint_must_use)]
#[allow(missing_docs)]
pub macro offset_of($Container:ty, $($fields:tt).+ $(,)?) {
// The `{}` is for better error messages
crate::hint::must_use({builtin # offset_of($Container, $($fields).+)})
}
2 changes: 1 addition & 1 deletion library/core/src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! * [`SocketAddr`] represents socket addresses of either IPv4 or IPv6; [`SocketAddrV4`]
//! and [`SocketAddrV6`] are respectively IPv4 and IPv6 socket addresses

#![stable(feature = "ip_in_core", since = "CURRENT_RUSTC_VERSION")]
#![stable(feature = "ip_in_core", since = "1.77.0")]

#[stable(feature = "rust1", since = "1.0.0")]
pub use self::ip_addr::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
Expand Down
6 changes: 0 additions & 6 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use crate::cmp::Ordering;
use crate::fmt;
use crate::hash::{Hash, Hasher};
use crate::intrinsics;
#[cfg(bootstrap)]
use crate::marker::StructuralEq;
use crate::marker::StructuralPartialEq;
use crate::ops::{BitOr, BitOrAssign, Div, Neg, Rem};
use crate::str::FromStr;
Expand Down Expand Up @@ -581,10 +579,6 @@ macro_rules! nonzero_integer {
#[$stability]
impl Eq for $Ty {}

#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(bootstrap)]
impl StructuralEq for $Ty {}

#[$stability]
impl PartialOrd for $Ty {
#[inline]
Expand Down
Loading

0 comments on commit f4cfd87

Please sign in to comment.