Skip to content

Commit f826641

Browse files
committed
Auto merge of #83053 - oli-obk:const_stab_version, r=m-ou-se
Fix const stability `since` versions. fixes #82085 r? `@m-ou-se`
2 parents ed75d06 + 6f3635d commit f826641

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ impl String {
360360
/// let s = String::new();
361361
/// ```
362362
#[inline]
363-
#[rustc_const_stable(feature = "const_string_new", since = "1.32.0")]
363+
#[rustc_const_stable(feature = "const_string_new", since = "1.39.0")]
364364
#[stable(feature = "rust1", since = "1.0.0")]
365365
pub const fn new() -> String {
366366
String { vec: Vec::new() }

library/core/src/alloc/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl Layout {
9393
/// This function is unsafe as it does not verify the preconditions from
9494
/// [`Layout::from_size_align`].
9595
#[stable(feature = "alloc_layout", since = "1.28.0")]
96-
#[rustc_const_stable(feature = "alloc_layout", since = "1.28.0")]
96+
#[rustc_const_stable(feature = "alloc_layout", since = "1.36.0")]
9797
#[inline]
9898
pub const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self {
9999
// SAFETY: the caller must ensure that `align` is greater than zero.

library/core/src/cell.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ impl<T> Cell<T> {
325325
/// let c = Cell::new(5);
326326
/// ```
327327
#[stable(feature = "rust1", since = "1.0.0")]
328-
#[rustc_const_stable(feature = "const_cell_new", since = "1.32.0")]
328+
#[rustc_const_stable(feature = "const_cell_new", since = "1.24.0")]
329329
#[inline]
330330
pub const fn new(value: T) -> Cell<T> {
331331
Cell { value: UnsafeCell::new(value) }
@@ -655,7 +655,7 @@ impl<T> RefCell<T> {
655655
/// let c = RefCell::new(5);
656656
/// ```
657657
#[stable(feature = "rust1", since = "1.0.0")]
658-
#[rustc_const_stable(feature = "const_refcell_new", since = "1.32.0")]
658+
#[rustc_const_stable(feature = "const_refcell_new", since = "1.24.0")]
659659
#[inline]
660660
pub const fn new(value: T) -> RefCell<T> {
661661
RefCell { value: UnsafeCell::new(value), borrow: Cell::new(UNUSED) }

library/core/src/mem/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ pub fn forget_unsized<T: ?Sized>(t: T) {
297297
#[inline(always)]
298298
#[stable(feature = "rust1", since = "1.0.0")]
299299
#[rustc_promotable]
300-
#[rustc_const_stable(feature = "const_size_of", since = "1.32.0")]
300+
#[rustc_const_stable(feature = "const_size_of", since = "1.24.0")]
301301
pub const fn size_of<T>() -> usize {
302302
intrinsics::size_of::<T>()
303303
}
@@ -440,7 +440,7 @@ pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
440440
#[inline(always)]
441441
#[stable(feature = "rust1", since = "1.0.0")]
442442
#[rustc_promotable]
443-
#[rustc_const_stable(feature = "const_align_of", since = "1.32.0")]
443+
#[rustc_const_stable(feature = "const_align_of", since = "1.24.0")]
444444
pub const fn align_of<T>() -> usize {
445445
intrinsics::min_align_of::<T>()
446446
}

library/core/src/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
205205
#[inline(always)]
206206
#[stable(feature = "rust1", since = "1.0.0")]
207207
#[rustc_promotable]
208-
#[rustc_const_stable(feature = "const_ptr_null", since = "1.32.0")]
208+
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
209209
pub const fn null<T>() -> *const T {
210210
0 as *const T
211211
}
@@ -223,7 +223,7 @@ pub const fn null<T>() -> *const T {
223223
#[inline(always)]
224224
#[stable(feature = "rust1", since = "1.0.0")]
225225
#[rustc_promotable]
226-
#[rustc_const_stable(feature = "const_ptr_null", since = "1.32.0")]
226+
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
227227
pub const fn null_mut<T>() -> *mut T {
228228
0 as *mut T
229229
}

library/core/src/ptr/non_null.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<T: Sized> NonNull<T> {
7272
/// sentinel value. Types that lazily allocate must track initialization by
7373
/// some other means.
7474
#[stable(feature = "nonnull", since = "1.25.0")]
75-
#[rustc_const_stable(feature = "const_nonnull_dangling", since = "1.32.0")]
75+
#[rustc_const_stable(feature = "const_nonnull_dangling", since = "1.36.0")]
7676
#[inline]
7777
pub const fn dangling() -> Self {
7878
// SAFETY: mem::align_of() returns a non-zero usize which is then casted
@@ -156,7 +156,7 @@ impl<T: ?Sized> NonNull<T> {
156156
///
157157
/// `ptr` must be non-null.
158158
#[stable(feature = "nonnull", since = "1.25.0")]
159-
#[rustc_const_stable(feature = "const_nonnull_new_unchecked", since = "1.32.0")]
159+
#[rustc_const_stable(feature = "const_nonnull_new_unchecked", since = "1.25.0")]
160160
#[inline]
161161
pub const unsafe fn new_unchecked(ptr: *mut T) -> Self {
162162
// SAFETY: the caller must guarantee that `ptr` is non-null.
@@ -288,7 +288,7 @@ impl<T: ?Sized> NonNull<T> {
288288

289289
/// Casts to a pointer of another type.
290290
#[stable(feature = "nonnull_cast", since = "1.27.0")]
291-
#[rustc_const_stable(feature = "const_nonnull_cast", since = "1.32.0")]
291+
#[rustc_const_stable(feature = "const_nonnull_cast", since = "1.36.0")]
292292
#[inline]
293293
pub const fn cast<U>(self) -> NonNull<U> {
294294
// SAFETY: `self` is a `NonNull` pointer which is necessarily non-null

library/core/src/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<T> [T] {
9494
/// ```
9595
#[doc(alias = "length")]
9696
#[stable(feature = "rust1", since = "1.0.0")]
97-
#[rustc_const_stable(feature = "const_slice_len", since = "1.32.0")]
97+
#[rustc_const_stable(feature = "const_slice_len", since = "1.39.0")]
9898
#[inline]
9999
// SAFETY: const sound because we transmute out the length field as a usize (which it must be)
100100
#[rustc_allow_const_fn_unstable(const_fn_union)]
@@ -127,7 +127,7 @@ impl<T> [T] {
127127
/// assert!(!a.is_empty());
128128
/// ```
129129
#[stable(feature = "rust1", since = "1.0.0")]
130-
#[rustc_const_stable(feature = "const_slice_is_empty", since = "1.32.0")]
130+
#[rustc_const_stable(feature = "const_slice_is_empty", since = "1.39.0")]
131131
#[inline]
132132
pub const fn is_empty(&self) -> bool {
133133
self.len() == 0

library/core/src/str/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl str {
140140
/// ```
141141
#[doc(alias = "length")]
142142
#[stable(feature = "rust1", since = "1.0.0")]
143-
#[rustc_const_stable(feature = "const_str_len", since = "1.32.0")]
143+
#[rustc_const_stable(feature = "const_str_len", since = "1.39.0")]
144144
#[inline]
145145
pub const fn len(&self) -> usize {
146146
self.as_bytes().len()
@@ -161,7 +161,7 @@ impl str {
161161
/// ```
162162
#[inline]
163163
#[stable(feature = "rust1", since = "1.0.0")]
164-
#[rustc_const_stable(feature = "const_str_is_empty", since = "1.32.0")]
164+
#[rustc_const_stable(feature = "const_str_is_empty", since = "1.39.0")]
165165
pub const fn is_empty(&self) -> bool {
166166
self.len() == 0
167167
}
@@ -217,7 +217,7 @@ impl str {
217217
/// assert_eq!(b"bors", bytes);
218218
/// ```
219219
#[stable(feature = "rust1", since = "1.0.0")]
220-
#[rustc_const_stable(feature = "str_as_bytes", since = "1.32.0")]
220+
#[rustc_const_stable(feature = "str_as_bytes", since = "1.39.0")]
221221
#[inline(always)]
222222
#[allow(unused_attributes)]
223223
#[rustc_allow_const_fn_unstable(const_fn_transmute)]

library/core/src/sync/atomic.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl AtomicBool {
283283
/// ```
284284
#[inline]
285285
#[stable(feature = "rust1", since = "1.0.0")]
286-
#[rustc_const_stable(feature = "const_atomic_new", since = "1.32.0")]
286+
#[rustc_const_stable(feature = "const_atomic_new", since = "1.24.0")]
287287
pub const fn new(v: bool) -> AtomicBool {
288288
AtomicBool { v: UnsafeCell::new(v as u8) }
289289
}
@@ -883,7 +883,7 @@ impl<T> AtomicPtr<T> {
883883
/// ```
884884
#[inline]
885885
#[stable(feature = "rust1", since = "1.0.0")]
886-
#[rustc_const_stable(feature = "const_atomic_new", since = "1.32.0")]
886+
#[rustc_const_stable(feature = "const_atomic_new", since = "1.24.0")]
887887
pub const fn new(p: *mut T) -> AtomicPtr<T> {
888888
AtomicPtr { p: UnsafeCell::new(p) }
889889
}
@@ -2276,7 +2276,7 @@ macro_rules! atomic_int_ptr_sized {
22762276
stable(feature = "atomic_access", since = "1.15.0"),
22772277
stable(feature = "atomic_from", since = "1.23.0"),
22782278
stable(feature = "atomic_nand", since = "1.27.0"),
2279-
rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"),
2279+
rustc_const_stable(feature = "const_integer_atomics", since = "1.24.0"),
22802280
stable(feature = "rust1", since = "1.0.0"),
22812281
"isize",
22822282
"",
@@ -2296,7 +2296,7 @@ macro_rules! atomic_int_ptr_sized {
22962296
stable(feature = "atomic_access", since = "1.15.0"),
22972297
stable(feature = "atomic_from", since = "1.23.0"),
22982298
stable(feature = "atomic_nand", since = "1.27.0"),
2299-
rustc_const_stable(feature = "const_integer_atomics", since = "1.34.0"),
2299+
rustc_const_stable(feature = "const_integer_atomics", since = "1.24.0"),
23002300
stable(feature = "rust1", since = "1.0.0"),
23012301
"usize",
23022302
"",

0 commit comments

Comments
 (0)