diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 16 | ||||
| -rw-r--r-- | src/liballoc/slice.rs | 5 | ||||
| -rw-r--r-- | src/liballoc/str.rs | 5 |
3 files changed, 5 insertions, 21 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 0343787d0c0..6f125cdba81 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -300,10 +300,7 @@ impl<T: ?Sized> Box<T> { issue = "27730")] #[inline] pub unsafe fn from_unique(u: Unique<T>) -> Self { - #[cfg(stage0)] - return mem::transmute(u); - #[cfg(not(stage0))] - return Box(u); + Box(u) } /// Consumes the `Box`, returning the wrapped raw pointer. @@ -365,14 +362,9 @@ impl<T: ?Sized> Box<T> { issue = "27730")] #[inline] pub fn into_unique(b: Box<T>) -> Unique<T> { - #[cfg(stage0)] - return unsafe { mem::transmute(b) }; - #[cfg(not(stage0))] - return { - let unique = b.0; - mem::forget(b); - unique - }; + let unique = b.0; + mem::forget(b); + unique } /// Consumes and leaks the `Box`, returning a mutable reference, diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 0eee7fb722e..ac815629dcf 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -1626,11 +1626,8 @@ impl<T> [T] { } } -// FIXME(LukasKalbertodt): the `not(stage0)` constraint can be removed in the -// future once the stage0 compiler is new enough to know about the `slice_u8` -// lang item. #[lang = "slice_u8"] -#[cfg(all(not(stage0), not(test)))] +#[cfg(not(test))] impl [u8] { /// Checks if all bytes in this slice are within the ASCII range. #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 9755c5d54f2..975ea4e1a3e 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -2110,7 +2110,6 @@ impl str { /// [`to_uppercase`]: #method.to_uppercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] #[inline] - #[cfg(not(stage0))] pub fn to_ascii_uppercase(&self) -> String { let mut bytes = self.as_bytes().to_vec(); bytes.make_ascii_uppercase(); @@ -2141,7 +2140,6 @@ impl str { /// [`to_lowercase`]: #method.to_lowercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] #[inline] - #[cfg(not(stage0))] pub fn to_ascii_lowercase(&self) -> String { let mut bytes = self.as_bytes().to_vec(); bytes.make_ascii_lowercase(); @@ -2163,7 +2161,6 @@ impl str { /// ``` #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] #[inline] - #[cfg(not(stage0))] pub fn eq_ignore_ascii_case(&self, other: &str) -> bool { self.as_bytes().eq_ignore_ascii_case(other.as_bytes()) } @@ -2178,7 +2175,6 @@ impl str { /// /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] - #[cfg(not(stage0))] pub fn make_ascii_uppercase(&mut self) { let me = unsafe { self.as_bytes_mut() }; me.make_ascii_uppercase() @@ -2194,7 +2190,6 @@ impl str { /// /// [`to_ascii_lowercase`]: #method.to_ascii_lowercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] - #[cfg(not(stage0))] pub fn make_ascii_lowercase(&mut self) { let me = unsafe { self.as_bytes_mut() }; me.make_ascii_lowercase() |
