Skip to content

Commit bde2adf

Browse files
authored
Unrolled build for rust-lang#132482
Rollup merge of rust-lang#132482 - lukas-code:stab-attrs, r=Noratrieb library: fix some stability annotations This PR updates some stability attributes to correctly reflect when some items actually got stabilized. Found while testing rust-lang#132481. ### `core::char` / `std::char` In rust-lang#26192, the `core::char` module got "stabilized" for 1.2.0, but the `core` crate itself was still unstable until 1.6.0. In rust-lang#49698, the `std::char` module was changed to a re-export of `core::char`, making `std::char` appear as "stable since 1.2.0", even though it was already stable in 1.0.0. By marking `core::char` as stable since 1.0.0, the docs will show correct versions for both `core::char` (since 1.6.0) and `std::char` (since 1.0.0). This is also consistent with the stabilities of similar re-exported modules like `core::mem`/`std::mem` for example. ### `{core,std}::array` and `{core,std}::array::TryFromSliceError` In rust-lang#58302, the `core::array::TryFromSliceError` type got stabilized for 1.34.0, together with `TryFrom`. At that point the `core::array` module was still unstable and a `std::array` re-export didn't exist, but `core::array::TryFromSliceError` could still be named due to rust-lang#95956 to existing yet. Then, `core::array` got stabilized and `std::array` got added, first targeting 1.36.0 in rust-lang#60657, but then getting backported for 1.35.0 in rust-lang#60838. This means that `core::array` and `std::array` actually got stabilized in 1.35.0 and `core::array::TryFromSliceError` was accessible through the unstable module in 1.34.0 -- mark them as such so that the docs display the correct versions.
2 parents 588a420 + 2a6a706 commit bde2adf

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

library/core/src/array/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! *[See also the array primitive type](array).*
44
5-
#![stable(feature = "core_array", since = "1.36.0")]
5+
#![stable(feature = "core_array", since = "1.35.0")]
66

77
use crate::borrow::{Borrow, BorrowMut};
88
use crate::cmp::Ordering;
@@ -154,10 +154,11 @@ pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
154154

155155
/// The error type returned when a conversion from a slice to an array fails.
156156
#[stable(feature = "try_from", since = "1.34.0")]
157+
#[rustc_allowed_through_unstable_modules]
157158
#[derive(Debug, Copy, Clone)]
158159
pub struct TryFromSliceError(());
159160

160-
#[stable(feature = "core_array", since = "1.36.0")]
161+
#[stable(feature = "core_array", since = "1.35.0")]
161162
impl fmt::Display for TryFromSliceError {
162163
#[inline]
163164
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

library/core/src/char/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! functions that convert various types to `char`.
1919
2020
#![allow(non_snake_case)]
21-
#![stable(feature = "core_char", since = "1.2.0")]
21+
#![stable(feature = "rust1", since = "1.0.0")]
2222

2323
mod convert;
2424
mod decode;

library/std/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ pub mod prelude;
481481

482482
#[stable(feature = "rust1", since = "1.0.0")]
483483
pub use core::any;
484-
#[stable(feature = "core_array", since = "1.36.0")]
484+
#[stable(feature = "core_array", since = "1.35.0")]
485485
pub use core::array;
486486
#[unstable(feature = "async_iterator", issue = "79024")]
487487
pub use core::async_iter;

0 commit comments

Comments
 (0)