Skip to content

Merge subtree update for toolchain nightly-2025-03-17 #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions library/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/rust-lang/rust.git"
description = "The Rust core allocation and collections library"
autotests = false
autobenches = false
edition = "2021"
edition = "2024"

[lib]
test = false
Expand Down
34 changes: 23 additions & 11 deletions library/alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,11 +1327,14 @@ impl<T: ?Sized> Rc<T> {
///
/// # Safety
///
/// The pointer must have been obtained through `Rc::into_raw`, the
/// associated `Rc` instance must be valid (i.e. the strong count must be at
/// The pointer must have been obtained through `Rc::into_raw` and must satisfy the
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
/// least 1) for the duration of this method, and `ptr` must point to a block of memory
/// allocated by the global allocator.
///
/// [from_raw_in]: Rc::from_raw_in
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -1360,12 +1363,15 @@ impl<T: ?Sized> Rc<T> {
///
/// # Safety
///
/// The pointer must have been obtained through `Rc::into_raw`, the
/// associated `Rc` instance must be valid (i.e. the strong count must be at
/// The pointer must have been obtained through `Rc::into_raw`and must satisfy the
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
/// least 1) when invoking this method, and `ptr` must point to a block of memory
/// allocated by the global allocator. This method can be used to release the final `Rc` and
/// backing storage, but **should not** be called after the final `Rc` has been released.
///
/// [from_raw_in]: Rc::from_raw_in
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -1623,10 +1629,13 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
///
/// # Safety
///
/// The pointer must have been obtained through `Rc::into_raw`, the
/// associated `Rc` instance must be valid (i.e. the strong count must be at
/// The pointer must have been obtained through `Rc::into_raw` and must satisfy the
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
/// least 1) for the duration of this method, and `ptr` must point to a block of memory
/// allocated by `alloc`
/// allocated by `alloc`.
///
/// [from_raw_in]: Rc::from_raw_in
///
/// # Examples
///
Expand Down Expand Up @@ -1665,11 +1674,14 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
///
/// # Safety
///
/// The pointer must have been obtained through `Rc::into_raw`, the
/// associated `Rc` instance must be valid (i.e. the strong count must be at
/// The pointer must have been obtained through `Rc::into_raw`and must satisfy the
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
/// least 1) when invoking this method, and `ptr` must point to a block of memory
/// allocated by `alloc`. This method can be used to release the final `Rc` and backing storage,
/// but **should not** be called after the final `Rc` has been released.
/// allocated by `alloc`. This method can be used to release the final `Rc` and
/// backing storage, but **should not** be called after the final `Rc` has been released.
///
/// [from_raw_in]: Rc::from_raw_in
///
/// # Examples
///
Expand Down
30 changes: 21 additions & 9 deletions library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1453,11 +1453,14 @@ impl<T: ?Sized> Arc<T> {
///
/// # Safety
///
/// The pointer must have been obtained through `Arc::into_raw`, and the
/// associated `Arc` instance must be valid (i.e. the strong count must be at
/// The pointer must have been obtained through `Arc::into_raw` and must satisfy the
/// same layout requirements specified in [`Arc::from_raw_in`][from_raw_in].
/// The associated `Arc` instance must be valid (i.e. the strong count must be at
/// least 1) for the duration of this method, and `ptr` must point to a block of memory
/// allocated by the global allocator.
///
/// [from_raw_in]: Arc::from_raw_in
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -1488,13 +1491,16 @@ impl<T: ?Sized> Arc<T> {
///
/// # Safety
///
/// The pointer must have been obtained through `Arc::into_raw`, and the
/// associated `Arc` instance must be valid (i.e. the strong count must be at
/// The pointer must have been obtained through `Arc::into_raw` and must satisfy the
/// same layout requirements specified in [`Arc::from_raw_in`][from_raw_in].
/// The associated `Arc` instance must be valid (i.e. the strong count must be at
/// least 1) when invoking this method, and `ptr` must point to a block of memory
/// allocated by the global allocator. This method can be used to release the final
/// `Arc` and backing storage, but **should not** be called after the final `Arc` has been
/// released.
///
/// [from_raw_in]: Arc::from_raw_in
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -1806,11 +1812,14 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
///
/// # Safety
///
/// The pointer must have been obtained through `Arc::into_raw`, and the
/// associated `Arc` instance must be valid (i.e. the strong count must be at
/// least 1) for the duration of this method,, and `ptr` must point to a block of memory
/// The pointer must have been obtained through `Arc::into_raw` and must satisfy the
/// same layout requirements specified in [`Arc::from_raw_in`][from_raw_in].
/// The associated `Arc` instance must be valid (i.e. the strong count must be at
/// least 1) for the duration of this method, and `ptr` must point to a block of memory
/// allocated by `alloc`.
///
/// [from_raw_in]: Arc::from_raw_in
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -1850,13 +1859,16 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
///
/// # Safety
///
/// The pointer must have been obtained through `Arc::into_raw`, the
/// associated `Arc` instance must be valid (i.e. the strong count must be at
/// The pointer must have been obtained through `Arc::into_raw` and must satisfy the
/// same layout requirements specified in [`Arc::from_raw_in`][from_raw_in].
/// The associated `Arc` instance must be valid (i.e. the strong count must be at
/// least 1) when invoking this method, and `ptr` must point to a block of memory
/// allocated by `alloc`. This method can be used to release the final
/// `Arc` and backing storage, but **should not** be called after the final `Arc` has been
/// released.
///
/// [from_raw_in]: Arc::from_raw_in
///
/// # Examples
///
/// ```
Expand Down
2 changes: 1 addition & 1 deletion library/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ autobenches = false
# If you update this, be sure to update it in a bunch of other places too!
# As of 2024, it was src/tools/opt-dist, the core-no-fp-fmt-parse test and
# the version of the prelude imported in core/lib.rs.
edition = "2021"
edition = "2024"

[lib]
test = false
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ use crate::{fmt, hash, intrinsics};
// unsafe traits and unsafe methods (i.e., `type_id` would still be safe to call,
// but we would likely want to indicate as such in documentation).
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "Any")]
#[rustc_diagnostic_item = "Any"]
pub trait Any: 'static {
/// Gets the `TypeId` of `self`.
///
Expand Down
1 change: 0 additions & 1 deletion library/core/src/array/ascii.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::ascii;

#[cfg(not(test))]
impl<const N: usize> [u8; N] {
/// Converts this array of bytes into an array of ASCII characters,
/// or returns `None` if any of the characters is non-ASCII.
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl bool {
/// ```
#[doc(alias = "then_with")]
#[stable(feature = "lazy_bool_to_option", since = "1.50.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "bool_then")]
#[rustc_diagnostic_item = "bool_then"]
#[inline]
pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> {
if self { Some(f()) } else { None }
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pub use once::OnceCell;
/// ```
///
/// See the [module-level documentation](self) for more.
#[cfg_attr(not(test), rustc_diagnostic_item = "Cell")]
#[rustc_diagnostic_item = "Cell"]
#[stable(feature = "rust1", since = "1.0.0")]
#[repr(transparent)]
#[rustc_pub_transparent]
Expand Down Expand Up @@ -725,7 +725,7 @@ impl<T, const N: usize> Cell<[T; N]> {
/// A mutable memory location with dynamically checked borrow rules
///
/// See the [module-level documentation](self) for more.
#[cfg_attr(not(test), rustc_diagnostic_item = "RefCell")]
#[rustc_diagnostic_item = "RefCell"]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct RefCell<T: ?Sized> {
borrow: Cell<BorrowFlag>,
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ impl char {
#[must_use]
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_char_is_ascii", since = "1.32.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "char_is_ascii")]
#[rustc_diagnostic_item = "char_is_ascii"]
#[inline]
pub const fn is_ascii(&self) -> bool {
*self as u32 <= 0x7F
Expand Down
Loading
Loading