Rollup merge of #89036 - nbdd0121:alloc, r=yaahc
Fix missing `no_global_oom_handling` cfg-gating Cfg-gate these trait impls that are neglected. These functions compile now because they use `box` syntax which depends on `exchange_malloc` during codegen only; as a result they compiles with cfg `no_global_oom_handling` but shouldn't. Discovered in #89030 because that PR makes `box` syntax depend on `exchange_malloc` lang item during MIR construction.
This commit is contained in:
commit
00635511db
@ -1086,6 +1086,7 @@ fn drop(&mut self) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(no_global_oom_handling))]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl<T: Default> Default for Box<T> {
|
impl<T: Default> Default for Box<T> {
|
||||||
/// Creates a `Box<T>`, with the `Default` value for T.
|
/// Creates a `Box<T>`, with the `Default` value for T.
|
||||||
@ -1394,6 +1395,7 @@ fn from(s: Box<str, A>) -> Self {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(no_global_oom_handling))]
|
||||||
#[stable(feature = "box_from_array", since = "1.45.0")]
|
#[stable(feature = "box_from_array", since = "1.45.0")]
|
||||||
impl<T, const N: usize> From<[T; N]> for Box<[T]> {
|
impl<T, const N: usize> From<[T; N]> for Box<[T]> {
|
||||||
/// Converts a `[T; N]` into a `Box<[T]>`
|
/// Converts a `[T; N]` into a `Box<[T]>`
|
||||||
|
@ -2841,6 +2841,7 @@ fn from(s: &mut [T]) -> Vec<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(no_global_oom_handling))]
|
||||||
#[stable(feature = "vec_from_array", since = "1.44.0")]
|
#[stable(feature = "vec_from_array", since = "1.44.0")]
|
||||||
impl<T, const N: usize> From<[T; N]> for Vec<T> {
|
impl<T, const N: usize> From<[T; N]> for Vec<T> {
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
|
Loading…
Reference in New Issue
Block a user