diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-18 12:00:59 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-18 12:16:19 -0500 |
| commit | 82184440ecd33e87cd03a8f7c70af2ad95d5400f (patch) | |
| tree | 1eda0bfec40ffa7bc2d180c8182cfa81912df2dd /src/libcore/ptr | |
| parent | 6a400ee14967a0210c31a6e272d56cbbb2b372dd (diff) | |
Propagate cfg bootstrap
Diffstat (limited to 'src/libcore/ptr')
| -rw-r--r-- | src/libcore/ptr/mod.rs | 20 | ||||
| -rw-r--r-- | src/libcore/ptr/non_null.rs | 20 |
2 files changed, 10 insertions, 30 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 33c23233fd1..776165e7bd7 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -198,7 +198,7 @@ unsafe fn real_drop_in_place<T: ?Sized>(to_drop: &mut T) { #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_null", since = "1.32.0"))] +#[rustc_const_stable(feature = "const_ptr_null", since = "1.32.0")] pub const fn null<T>() -> *const T { 0 as *const T } @@ -216,7 +216,7 @@ pub const fn null<T>() -> *const T { #[inline(always)] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_promotable] -#[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_null", since = "1.32.0"))] +#[rustc_const_stable(feature = "const_ptr_null", since = "1.32.0")] pub const fn null_mut<T>() -> *mut T { 0 as *mut T } @@ -1062,7 +1062,7 @@ impl<T: ?Sized> *const T { /// Casts to a pointer of another type. #[stable(feature = "ptr_cast", since = "1.38.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0"))] + #[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")] #[inline] pub const fn cast<U>(self) -> *const U { self as _ @@ -1310,11 +1310,7 @@ impl<T: ?Sized> *const T { /// } /// ``` #[unstable(feature = "ptr_offset_from", issue = "41079")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_ptr_offset_from"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079"), - )] + #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")] #[inline] pub const unsafe fn offset_from(self, origin: *const T) -> isize where @@ -1770,7 +1766,7 @@ impl<T: ?Sized> *mut T { /// Casts to a pointer of another type. #[stable(feature = "ptr_cast", since = "1.38.0")] - #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0"))] + #[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")] #[inline] pub const fn cast<U>(self) -> *mut U { self as _ @@ -2057,11 +2053,7 @@ impl<T: ?Sized> *mut T { /// } /// ``` #[unstable(feature = "ptr_offset_from", issue = "41079")] - #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_ptr_offset_from"))] - #[cfg_attr( - not(bootstrap), - rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079"), - )] + #[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")] #[inline] pub const unsafe fn offset_from(self, origin: *const T) -> isize where diff --git a/src/libcore/ptr/non_null.rs b/src/libcore/ptr/non_null.rs index d1d97d7b332..6946fd2413e 100644 --- a/src/libcore/ptr/non_null.rs +++ b/src/libcore/ptr/non_null.rs @@ -66,10 +66,7 @@ impl<T: Sized> NonNull<T> { /// sentinel value. Types that lazily allocate must track initialization by /// some other means. #[stable(feature = "nonnull", since = "1.25.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_dangling", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_dangling", since = "1.32.0")] #[inline] pub const fn dangling() -> Self { unsafe { @@ -86,10 +83,7 @@ impl<T: ?Sized> NonNull<T> { /// /// `ptr` must be non-null. #[stable(feature = "nonnull", since = "1.25.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_new_unchecked", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_new_unchecked", since = "1.32.0")] #[inline] pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { NonNull { pointer: ptr as _ } @@ -104,10 +98,7 @@ impl<T: ?Sized> NonNull<T> { /// Acquires the underlying `*mut` pointer. #[stable(feature = "nonnull", since = "1.25.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_as_ptr", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_as_ptr", since = "1.32.0")] #[inline] pub const fn as_ptr(self) -> *mut T { self.pointer as *mut T @@ -137,10 +128,7 @@ impl<T: ?Sized> NonNull<T> { /// Casts to a pointer of another type. #[stable(feature = "nonnull_cast", since = "1.27.0")] - #[cfg_attr( - not(bootstrap), - rustc_const_stable(feature = "const_nonnull_cast", since = "1.32.0"), - )] + #[rustc_const_stable(feature = "const_nonnull_cast", since = "1.32.0")] #[inline] pub const fn cast<U>(self) -> NonNull<U> { unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } |
