diff options
| author | bors <bors@rust-lang.org> | 2022-07-03 06:55:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-07-03 06:55:50 +0000 |
| commit | ada8c80bedb713b320af00aacab97d01d9cb5933 (patch) | |
| tree | cf02cbbf9875573f0a5b357ef1829fedfd27202d /library/alloc/src | |
| parent | 8c52a83c455f0044e00add954cb7d9ddb0dfb9a3 (diff) | |
| parent | d8bfae4f9903a803c8b45d647934f2e53b0b3eea (diff) | |
| download | rust-ada8c80bedb713b320af00aacab97d01d9cb5933.tar.gz rust-ada8c80bedb713b320af00aacab97d01d9cb5933.zip | |
Auto merge of #98673 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrum
Bump bootstrap compiler r? `@Mark-Simulacrum`
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/boxed.rs | 25 | ||||
| -rw-r--r-- | library/alloc/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/alloc/src/macros.rs | 20 | ||||
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 2 |
4 files changed, 6 insertions, 42 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index cc395759b20..d83bab7bbbd 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -206,7 +206,7 @@ impl<T> Box<T> { /// ``` /// let five = Box::new(5); /// ``` - #[cfg(all(not(no_global_oom_handling), not(bootstrap)))] + #[cfg(all(not(no_global_oom_handling)))] #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[must_use] @@ -215,23 +215,6 @@ impl<T> Box<T> { Box::new(x) } - /// Allocates memory on the heap and then places `x` into it. - /// - /// This doesn't actually allocate if `T` is zero-sized. - /// - /// # Examples - /// - /// ``` - /// let five = Box::new(5); - /// ``` - #[cfg(all(not(no_global_oom_handling), bootstrap))] - #[inline(always)] - #[stable(feature = "rust1", since = "1.0.0")] - #[must_use] - pub fn new(x: T) -> Self { - box x - } - /// Constructs a new box with uninitialized contents. /// /// # Examples @@ -296,7 +279,7 @@ impl<T> Box<T> { #[must_use] #[inline(always)] pub fn pin(x: T) -> Pin<Box<T>> { - (#[cfg_attr(not(bootstrap), rustc_box)] + (#[rustc_box] Box::new(x)) .into() } @@ -1255,7 +1238,7 @@ unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> Drop for Box<T, A> { impl<T: Default> Default for Box<T> { /// Creates a `Box<T>`, with the `Default` value for T. fn default() -> Self { - #[cfg_attr(not(bootstrap), rustc_box)] + #[rustc_box] Box::new(T::default()) } } @@ -1628,7 +1611,7 @@ impl<T, const N: usize> From<[T; N]> for Box<[T]> { /// println!("{boxed:?}"); /// ``` fn from(array: [T; N]) -> Box<[T]> { - #[cfg_attr(not(bootstrap), rustc_box)] + #[rustc_box] Box::new(array) } } diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index c08caa7b93e..d3816d70b63 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -149,7 +149,6 @@ #![feature(allocator_internals)] #![feature(allow_internal_unstable)] #![feature(associated_type_bounds)] -#![cfg_attr(bootstrap, feature(box_syntax))] #![feature(cfg_sanitize)] #![feature(const_deref)] #![feature(const_mut_refs)] diff --git a/library/alloc/src/macros.rs b/library/alloc/src/macros.rs index 37898b6655f..88eb6aa7a83 100644 --- a/library/alloc/src/macros.rs +++ b/library/alloc/src/macros.rs @@ -34,7 +34,7 @@ /// be mindful of side effects. /// /// [`Vec`]: crate::vec::Vec -#[cfg(all(not(no_global_oom_handling), not(test), not(bootstrap)))] +#[cfg(all(not(no_global_oom_handling), not(test)))] #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "vec_macro"] @@ -54,24 +54,6 @@ macro_rules! vec { ); } -/// Creates a `Vec` containing the arguments (bootstrap version). -#[cfg(all(not(no_global_oom_handling), not(test), bootstrap))] -#[macro_export] -#[stable(feature = "rust1", since = "1.0.0")] -#[rustc_diagnostic_item = "vec_macro"] -#[allow_internal_unstable(box_syntax, liballoc_internals)] -macro_rules! vec { - () => ( - $crate::__rust_force_expr!($crate::vec::Vec::new()) - ); - ($elem:expr; $n:expr) => ( - $crate::__rust_force_expr!($crate::vec::from_elem($elem, $n)) - ); - ($($x:expr),+ $(,)?) => ( - $crate::__rust_force_expr!(<[_]>::into_vec(box [$($x),+])) - ); -} - // HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is // required for this macro definition, is not available. Instead use the // `slice::into_vec` function which is only available with cfg(test) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index e25f98d8aa6..05370576661 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -3017,7 +3017,7 @@ impl<T, const N: usize> From<[T; N]> for Vec<T> { #[cfg(not(test))] fn from(s: [T; N]) -> Vec<T> { <[T]>::into_vec( - #[cfg_attr(not(bootstrap), rustc_box)] + #[rustc_box] Box::new(s), ) } |
