Skip to content

Commit

Permalink
Auto merge of rust-lang#126273 - pietroalbini:pa-bootstrap-update, r=…
Browse files Browse the repository at this point in the history
…Mark-Simulacrum

Bump stage0 to 1.80.0

r? `@Mark-Simulacrum`
  • Loading branch information
bors committed Jun 12, 2024
2 parents 027c82e + d8fe589 commit 17c90d8
Show file tree
Hide file tree
Showing 31 changed files with 130 additions and 197 deletions.
27 changes: 13 additions & 14 deletions alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@
//! to `into_iter()` for boxed slices will defer to the slice implementation on editions before
//! 2024:
//!
#![cfg_attr(bootstrap, doc = "```rust,edition2021,ignore")]
#![cfg_attr(not(bootstrap), doc = "```rust,edition2021")]
//! ```rust,edition2021
//! // Rust 2015, 2018, and 2021:
//!
//! # #![allow(boxed_slice_into_iter)] // override our `deny(warnings)`
Expand Down Expand Up @@ -2123,23 +2122,23 @@ impl<I> FromIterator<I> for Box<[I]> {

/// This implementation is required to make sure that the `Box<[I]>: IntoIterator`
/// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<I, A: Allocator> !Iterator for Box<[I], A> {}

/// This implementation is required to make sure that the `&Box<[I]>: IntoIterator`
/// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> !Iterator for &'a Box<[I], A> {}

/// This implementation is required to make sure that the `&mut Box<[I]>: IntoIterator`
/// implementation doesn't overlap with `IntoIterator for T where T: Iterator` blanket.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> !Iterator for &'a mut Box<[I], A> {}

// Note: the `#[rustc_skip_during_method_dispatch(boxed_slice)]` on `trait IntoIterator`
// hides this implementation from explicit `.into_iter()` calls on editions < 2024,
// so those calls will still resolve to the slice implementation, by reference.
#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<I, A: Allocator> IntoIterator for Box<[I], A> {
type IntoIter = vec::IntoIter<I, A>;
type Item = I;
Expand All @@ -2148,7 +2147,7 @@ impl<I, A: Allocator> IntoIterator for Box<[I], A> {
}
}

#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> IntoIterator for &'a Box<[I], A> {
type IntoIter = slice::Iter<'a, I>;
type Item = &'a I;
Expand All @@ -2157,7 +2156,7 @@ impl<'a, I, A: Allocator> IntoIterator for &'a Box<[I], A> {
}
}

#[stable(feature = "boxed_slice_into_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_slice_into_iter", since = "1.80.0")]
impl<'a, I, A: Allocator> IntoIterator for &'a mut Box<[I], A> {
type IntoIter = slice::IterMut<'a, I>;
type Item = &'a mut I;
Expand All @@ -2167,47 +2166,47 @@ impl<'a, I, A: Allocator> IntoIterator for &'a mut Box<[I], A> {
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl FromIterator<char> for Box<str> {
fn from_iter<T: IntoIterator<Item = char>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
}
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<'a> FromIterator<&'a char> for Box<str> {
fn from_iter<T: IntoIterator<Item = &'a char>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
}
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<'a> FromIterator<&'a str> for Box<str> {
fn from_iter<T: IntoIterator<Item = &'a str>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
}
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl FromIterator<String> for Box<str> {
fn from_iter<T: IntoIterator<Item = String>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
}
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<A: Allocator> FromIterator<Box<str, A>> for Box<str> {
fn from_iter<T: IntoIterator<Item = Box<str, A>>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
}
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "boxed_str_from_iter", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "boxed_str_from_iter", since = "1.80.0")]
impl<'a> FromIterator<Cow<'a, str>> for Box<str> {
fn from_iter<T: IntoIterator<Item = Cow<'a, str>>>(iter: T) -> Self {
String::from_iter(iter).into_boxed_str()
Expand Down
7 changes: 2 additions & 5 deletions alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,7 @@ impl<T: Ord> BinaryHeap<T> {
/// heap.push(4);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(
feature = "const_binary_heap_constructor",
since = "CURRENT_RUSTC_VERSION"
)]
#[rustc_const_stable(feature = "const_binary_heap_constructor", since = "1.80.0")]
#[must_use]
pub const fn new() -> BinaryHeap<T> {
BinaryHeap { data: vec![] }
Expand Down Expand Up @@ -1224,7 +1221,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
/// io::sink().write(heap.as_slice()).unwrap();
/// ```
#[must_use]
#[stable(feature = "binary_heap_as_slice", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "binary_heap_as_slice", since = "1.80.0")]
pub fn as_slice(&self) -> &[T] {
self.data.as_slice()
}
Expand Down
2 changes: 1 addition & 1 deletion alloc/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ impl From<&CStr> for Rc<CStr> {
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Rc<CStr> {
/// Creates an empty CStr inside an Rc
///
Expand Down
1 change: 0 additions & 1 deletion alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
//
// Language features:
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(exclusive_range_pattern))]
#![cfg_attr(not(test), feature(coroutine_trait))]
#![cfg_attr(test, feature(panic_update_hook))]
#![cfg_attr(test, feature(test))]
Expand Down
4 changes: 2 additions & 2 deletions alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ impl<T: Default> Default for Rc<T> {
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Rc<str> {
/// Creates an empty str inside an Rc
///
Expand All @@ -2262,7 +2262,7 @@ impl Default for Rc<str> {
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl<T> Default for Rc<[T]> {
/// Creates an empty `[T]` inside an Rc
///
Expand Down
6 changes: 3 additions & 3 deletions alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3405,7 +3405,7 @@ static STATIC_INNER_SLICE: SliceArcInnerForStatic = SliceArcInnerForStatic {
};

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Arc<str> {
/// Creates an empty str inside an Arc
///
Expand All @@ -3420,7 +3420,7 @@ impl Default for Arc<str> {
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl Default for Arc<core::ffi::CStr> {
/// Creates an empty CStr inside an Arc
///
Expand All @@ -3439,7 +3439,7 @@ impl Default for Arc<core::ffi::CStr> {
}

#[cfg(not(no_global_oom_handling))]
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "more_rc_default_impls", since = "1.80.0")]
impl<T> Default for Arc<[T]> {
/// Creates an empty `[T]` inside an Arc
///
Expand Down
2 changes: 1 addition & 1 deletion alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,7 @@ impl<T, A: Allocator, const N: usize> Vec<[T; N], A> {
/// let mut flattened = vec.into_flattened();
/// assert_eq!(flattened.pop(), Some(6));
/// ```
#[stable(feature = "slice_flatten", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "slice_flatten", since = "1.80.0")]
pub fn into_flattened(self) -> Vec<T, A> {
let (ptr, len, cap, alloc) = self.into_raw_parts_with_alloc();
let (new_len, new_cap) = if T::IS_ZST {
Expand Down
2 changes: 1 addition & 1 deletion core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ use crate::ptr::{self, NonNull};
mod lazy;
mod once;

#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub use lazy::LazyCell;
#[stable(feature = "once_cell", since = "1.70.0")]
pub use once::OnceCell;
Expand Down
14 changes: 7 additions & 7 deletions core/src/cell/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum State<T, F> {
/// // 92
/// // 92
/// ```
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub struct LazyCell<T, F = fn() -> T> {
state: UnsafeCell<State<T, F>>,
}
Expand All @@ -54,8 +54,8 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
/// assert_eq!(&*lazy, "HELLO, WORLD!");
/// ```
#[inline]
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
#[rustc_const_stable(feature = "lazy_cell", since = "1.80.0")]
pub const fn new(f: F) -> LazyCell<T, F> {
LazyCell { state: UnsafeCell::new(State::Uninit(f)) }
}
Expand Down Expand Up @@ -103,7 +103,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
/// assert_eq!(&*lazy, &92);
/// ```
#[inline]
#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
pub fn force(this: &LazyCell<T, F>) -> &T {
// SAFETY:
// This invalidates any mutable references to the data. The resulting
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<T, F> LazyCell<T, F> {
}
}

#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T, F: FnOnce() -> T> Deref for LazyCell<T, F> {
type Target = T;
#[inline]
Expand All @@ -176,7 +176,7 @@ impl<T, F: FnOnce() -> T> Deref for LazyCell<T, F> {
}
}

#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: Default> Default for LazyCell<T> {
/// Creates a new lazy value using `Default` as the initializing function.
#[inline]
Expand All @@ -185,7 +185,7 @@ impl<T: Default> Default for LazyCell<T> {
}
}

#[stable(feature = "lazy_cell", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "lazy_cell", since = "1.80.0")]
impl<T: fmt::Debug, F> fmt::Debug for LazyCell<T, F> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut d = f.debug_tuple("LazyCell");
Expand Down
1 change: 0 additions & 1 deletion core/src/future/async_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ async unsafe fn either<O: IntoFuture<Output = ()>, M: IntoFuture<Output = ()>, T
}
}

#[cfg(not(bootstrap))]
#[lang = "async_drop_deferred_drop_in_place"]
async unsafe fn deferred_drop_in_place<T>(to_drop: *mut T) {
// SAFETY: same safety requirements as with drop_in_place (implied by
Expand Down
2 changes: 1 addition & 1 deletion core/src/future/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::task::{Context, Poll};
pub trait Future {
/// The type of value produced on completion.
#[stable(feature = "futures_api", since = "1.36.0")]
#[cfg_attr(not(bootstrap), lang = "future_output")]
#[lang = "future_output"]
type Output;

/// Attempt to resolve the future to a final value, registering
Expand Down
11 changes: 5 additions & 6 deletions core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ pub const unsafe fn assume(b: bool) {
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_intrinsic]
#[rustc_nounwind]
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
#[miri::intrinsic_fallback_is_spec]
pub const fn likely(b: bool) -> bool {
b
}
Expand All @@ -1006,7 +1006,7 @@ pub const fn likely(b: bool) -> bool {
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_intrinsic]
#[rustc_nounwind]
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
#[miri::intrinsic_fallback_is_spec]
pub const fn unlikely(b: bool) -> bool {
b
}
Expand Down Expand Up @@ -2482,7 +2482,7 @@ extern "rust-intrinsic" {
#[rustc_nounwind]
#[rustc_do_not_const_check]
#[inline]
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
#[miri::intrinsic_fallback_is_spec]
pub const fn ptr_guaranteed_cmp<T>(ptr: *const T, other: *const T) -> u8 {
(ptr == other) as u8
}
Expand Down Expand Up @@ -2747,7 +2747,7 @@ pub const fn ub_checks() -> bool {
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_nounwind]
#[rustc_intrinsic]
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
#[miri::intrinsic_fallback_is_spec]
pub const unsafe fn const_allocate(_size: usize, _align: usize) -> *mut u8 {
// const eval overrides this function, but runtime code for now just returns null pointers.
// See <https://github.com/rust-lang/rust/issues/93935>.
Expand All @@ -2768,7 +2768,7 @@ pub const unsafe fn const_allocate(_size: usize, _align: usize) -> *mut u8 {
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_nounwind]
#[rustc_intrinsic]
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
#[miri::intrinsic_fallback_is_spec]
pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {
// Runtime NOP
}
Expand Down Expand Up @@ -2828,7 +2828,6 @@ impl<P: ?Sized, T: ptr::Thin> AggregateRawPtr<*mut T> for *mut P {
#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
#[cfg(not(bootstrap))]
pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *const P) -> M {
// To implement a fallback we'd have to assume the layout of the pointer,
// but the whole point of this intrinsic is that we shouldn't do that.
Expand Down
1 change: 0 additions & 1 deletion core/src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ extern "rust-intrinsic" {
///
/// `T` must be a vector of integers.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn simd_ctpop<T>(x: T) -> T;

/// Count the trailing zeros of each element.
Expand Down
3 changes: 1 addition & 2 deletions core/src/iter/traits/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ where
label = "`{Self}` is not an iterator",
message = "`{Self}` is not an iterator"
)]
#[cfg_attr(bootstrap, rustc_skip_array_during_method_dispatch)]
#[cfg_attr(not(bootstrap), rustc_skip_during_method_dispatch(array, boxed_slice))]
#[rustc_skip_during_method_dispatch(array, boxed_slice)]
#[stable(feature = "rust1", since = "1.0.0")]
pub trait IntoIterator {
/// The type of the elements being iterated over.
Expand Down
Loading

0 comments on commit 17c90d8

Please sign in to comment.