diff options
| author | bors <bors@rust-lang.org> | 2025-08-15 23:10:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-08-15 23:10:31 +0000 |
| commit | 1ae7c4907275f10b3db9e886bc8809ec063e45ee (patch) | |
| tree | bce067e7f6106de12f3eaeeada93e05b1e40673d /library/core/src | |
| parent | cd7cbe818e4a66d46fe2df993d1b8518eba8a5cd (diff) | |
| parent | cf28e2b0d58c2f4a7fdcb9b38f9a186716c07ab6 (diff) | |
| download | rust-1ae7c4907275f10b3db9e886bc8809ec063e45ee.tar.gz rust-1ae7c4907275f10b3db9e886bc8809ec063e45ee.zip | |
Auto merge of #145475 - jhpratt:rollup-jr0wado, r=jhpratt
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143717 (Add `Default` impls for `Pin`ned `Box`, `Rc`, `Arc`) - rust-lang/rust#144054 (Stabilize as_array_of_cells) - rust-lang/rust#144907 (fix: Reject async assoc fns of const traits/impls in ast_passes) - rust-lang/rust#144922 (Implement `#[derive(From)]`) - rust-lang/rust#144963 (Stabilize `core::iter::chain`) - rust-lang/rust#145436 (fix(tests/rmake/wasm-unexpected-features): change features from `WASM1` to `MVP`) - rust-lang/rust#145453 (Remove duplicated tracing span in bootstrap) - rust-lang/rust#145454 (Fix tracing debug representation of steps without arguments in bootstrap) - rust-lang/rust#145455 (Do not copy files in `copy_src_dirs` in dry run) - rust-lang/rust#145462 (Stabilize `const_exposed_provenance` feature) - rust-lang/rust#145466 (Enable new `[range-diff]` feature in triagebot) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/cell.rs | 4 | ||||
| -rw-r--r-- | library/core/src/iter/adapters/chain.rs | 4 | ||||
| -rw-r--r-- | library/core/src/iter/adapters/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/iter/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/macros/mod.rs | 11 | ||||
| -rw-r--r-- | library/core/src/prelude/v1.rs | 7 | ||||
| -rw-r--r-- | library/core/src/ptr/mod.rs | 4 |
7 files changed, 25 insertions, 9 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 9c578dcdc2a..59a6aa70620 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -698,14 +698,14 @@ impl<T, const N: usize> Cell<[T; N]> { /// # Examples /// /// ``` - /// #![feature(as_array_of_cells)] /// use std::cell::Cell; /// /// let mut array: [i32; 3] = [1, 2, 3]; /// let cell_array: &Cell<[i32; 3]> = Cell::from_mut(&mut array); /// let array_cell: &[Cell<i32>; 3] = cell_array.as_array_of_cells(); /// ``` - #[unstable(feature = "as_array_of_cells", issue = "88248")] + #[stable(feature = "as_array_of_cells", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "as_array_of_cells", since = "CURRENT_RUSTC_VERSION")] pub const fn as_array_of_cells(&self) -> &[Cell<T>; N] { // SAFETY: `Cell<T>` has the same memory layout as `T`. unsafe { &*(self as *const Cell<[T; N]> as *const [Cell<T>; N]) } diff --git a/library/core/src/iter/adapters/chain.rs b/library/core/src/iter/adapters/chain.rs index dad3d79acb1..943b88e2330 100644 --- a/library/core/src/iter/adapters/chain.rs +++ b/library/core/src/iter/adapters/chain.rs @@ -45,8 +45,6 @@ impl<A, B> Chain<A, B> { /// # Examples /// /// ``` -/// #![feature(iter_chain)] -/// /// use std::iter::chain; /// /// let a = [1, 2, 3]; @@ -62,7 +60,7 @@ impl<A, B> Chain<A, B> { /// assert_eq!(iter.next(), Some(6)); /// assert_eq!(iter.next(), None); /// ``` -#[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")] +#[stable(feature = "iter_chain", since = "CURRENT_RUSTC_VERSION")] pub fn chain<A, B>(a: A, b: B) -> Chain<A::IntoIter, B::IntoIter> where A: IntoIterator, diff --git a/library/core/src/iter/adapters/mod.rs b/library/core/src/iter/adapters/mod.rs index 2a0ef0189d1..6c6de0a4e5c 100644 --- a/library/core/src/iter/adapters/mod.rs +++ b/library/core/src/iter/adapters/mod.rs @@ -32,7 +32,7 @@ mod zip; pub use self::array_chunks::ArrayChunks; #[unstable(feature = "std_internals", issue = "none")] pub use self::by_ref_sized::ByRefSized; -#[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")] +#[stable(feature = "iter_chain", since = "CURRENT_RUSTC_VERSION")] pub use self::chain::chain; #[stable(feature = "iter_cloned", since = "1.1.0")] pub use self::cloned::Cloned; diff --git a/library/core/src/iter/mod.rs b/library/core/src/iter/mod.rs index 56ca1305b60..bc07324f520 100644 --- a/library/core/src/iter/mod.rs +++ b/library/core/src/iter/mod.rs @@ -404,7 +404,7 @@ pub use self::adapters::StepBy; pub use self::adapters::TrustedRandomAccess; #[unstable(feature = "trusted_random_access", issue = "none")] pub use self::adapters::TrustedRandomAccessNoCoerce; -#[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")] +#[stable(feature = "iter_chain", since = "CURRENT_RUSTC_VERSION")] pub use self::adapters::chain; pub(crate) use self::adapters::try_process; #[stable(feature = "iter_zip", since = "1.59.0")] diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index bb91d057454..ccf41dfb01d 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -1770,4 +1770,15 @@ pub(crate) mod builtin { pub macro deref($pat:pat) { builtin # deref($pat) } + + /// Derive macro generating an impl of the trait `From`. + /// Currently, it can only be used on single-field structs. + // Note that the macro is in a different module than the `From` trait, + // to avoid triggering an unstable feature being used if someone imports + // `std::convert::From`. + #[rustc_builtin_macro] + #[unstable(feature = "derive_from", issue = "144889")] + pub macro From($item: item) { + /* compiler built-in */ + } } diff --git a/library/core/src/prelude/v1.rs b/library/core/src/prelude/v1.rs index a4be66b90ca..d8d82afb0e6 100644 --- a/library/core/src/prelude/v1.rs +++ b/library/core/src/prelude/v1.rs @@ -117,3 +117,10 @@ pub use crate::macros::builtin::deref; reason = "`type_alias_impl_trait` has open design concerns" )] pub use crate::macros::builtin::define_opaque; + +#[unstable( + feature = "derive_from", + issue = "144889", + reason = "`derive(From)` is unstable" +)] +pub use crate::macros::builtin::From; diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index b2607e45324..be26e714e67 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -974,7 +974,7 @@ pub const fn dangling_mut<T>() -> *mut T { #[must_use] #[inline(always)] #[stable(feature = "exposed_provenance", since = "1.84.0")] -#[rustc_const_unstable(feature = "const_exposed_provenance", issue = "144538")] +#[rustc_const_stable(feature = "const_exposed_provenance", since = "CURRENT_RUSTC_VERSION")] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead pub const fn with_exposed_provenance<T>(addr: usize) -> *const T { @@ -1015,7 +1015,7 @@ pub const fn with_exposed_provenance<T>(addr: usize) -> *const T { #[must_use] #[inline(always)] #[stable(feature = "exposed_provenance", since = "1.84.0")] -#[rustc_const_unstable(feature = "const_exposed_provenance", issue = "144538")] +#[rustc_const_stable(feature = "const_exposed_provenance", since = "CURRENT_RUSTC_VERSION")] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead pub const fn with_exposed_provenance_mut<T>(addr: usize) -> *mut T { |
