Skip to content

Commit 5cf80a8

Browse files
github-actions[bot]RalfJungChrisDentonmatthiaskrgrDaniPopes
authored
Merge subtree update for toolchain nightly-2025-04-21 (model-checking#336)
This is an automated PR to merge library subtree updates from 2025-04-07 (rust-lang/rust@2fa8b11) to 2025-04-21 (rust-lang/rust@b8c54d6) (inclusive) into main. `git merge` resulted in conflicts, which require manual resolution. Files were commited with merge conflict markers. **Do not remove or edit the following annotations:** git-subtree-dir: library git-subtree-split: 2ab28f3 --------- Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn> Signed-off-by: Petros Angelatos <petrosagg@gmail.com> Signed-off-by: Huang Qi <huangqi3@xiaomi.com> Signed-off-by: Ayush Singh <ayush@beagleboard.org> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Co-authored-by: Ralf Jung <post@ralfj.de> Co-authored-by: Chris Denton <chris@chrisdenton.dev> Co-authored-by: Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Co-authored-by: bors <bors@rust-lang.org> Co-authored-by: Jacob Pratt <jacob@jhpratt.dev> Co-authored-by: beetrees <b@beetr.ee> Co-authored-by: Thalia Archibald <thalia@archibald.dev> Co-authored-by: Mads Marquart <mads@marquart.dk> Co-authored-by: Christopher Durham <cad97@cad97.com> Co-authored-by: James Wainwright <james.wainwright@lowrisc.org> Co-authored-by: joboet <jonasboettiger@icloud.com> Co-authored-by: Mara Bos <m-ou.se@m-ou.se> Co-authored-by: Rafael Bachmann <rafael.bachmann.93@gmail.com> Co-authored-by: xizheyin <xizheyin@smail.nju.edu.cn> Co-authored-by: Benoît du Garreau <benoit@dugarreau.fr> Co-authored-by: Nikolai Kuklin <nickkuklin@gmail.com> Co-authored-by: Frank King <frankking1729@gmail.com> Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com> Co-authored-by: Scott McMurray <scottmcm@users.noreply.github.com> Co-authored-by: mejrs <59372212+mejrs@users.noreply.github.com> Co-authored-by: okaneco <47607823+okaneco@users.noreply.github.com> Co-authored-by: clubby789 <jamie@hill-daniel.co.uk> Co-authored-by: Takayuki Maeda <takoyaki0316@gmail.com> Co-authored-by: Daniel Bloom <daniel@wormholelabs.xyz> Co-authored-by: Trevor Gross <tmgross@umich.edu> Co-authored-by: Jake Wharton <jw@squareup.com> Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com> Co-authored-by: Kornel <kornel@geekhood.net> Co-authored-by: Calder Coalson <caldercoalson@gmail.com> Co-authored-by: Stuart Cook <Zalathar@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: izarma <phuckuhh@gmail.com> Co-authored-by: Bennet Bleßmann <bb-github@t-online.de> Co-authored-by: Celina G. Val <celinval@amazon.com> Co-authored-by: Jonathan Gruner <jogru0@gmail.com> Co-authored-by: Stan Manilov <stanislav.manilov@gmail.com> Co-authored-by: Gabriel Bjørnager Jensen <gabriel@achernar.io> Co-authored-by: lincot <lincot@disroot.org> Co-authored-by: timesince <seekseat@icloud.com> Co-authored-by: Boxy <rust@boxyuwu.dev> Co-authored-by: oyvindln <oyvindln@users.noreply.github.com> Co-authored-by: Alice Ryhl <aliceryhl@google.com> Co-authored-by: Folkert de Vries <folkert@folkertdev.nl> Co-authored-by: Bastian Kersting <bkersting@google.com> Co-authored-by: Petros Angelatos <petrosagg@gmail.com> Co-authored-by: Jesus Checa Hidalgo <jchecahi@redhat.com> Co-authored-by: Michael Howell <michael@notriddle.com> Co-authored-by: Ricardo Fernández Serrata <76864299+Rudxain@users.noreply.github.com> Co-authored-by: GenYuLi <witherslin@synology.com> Co-authored-by: Chris Denton <christophersdenton@gmail.com> Co-authored-by: Amanieu d'Antras <amanieu@gmail.com> Co-authored-by: Sky <sky@sky9.dev> Co-authored-by: Huang Qi <huangqi3@xiaomi.com> Co-authored-by: Ayush Singh <ayush@beagleboard.org> Co-authored-by: 0x79de <0x79de@gmail.com> Co-authored-by: binarycat <binarycat@envs.net> Co-authored-by: Glyn Normington <glyn.normington@gmail.com> Co-authored-by: Tamir Duberstein <tamird@gmail.com> Co-authored-by: Josh Triplett <josh@joshtriplett.org> Co-authored-by: Bastian Kersting <bastian@cmbt.de> Co-authored-by: Lyndon Brown <jnqnfe@gmail.com> Co-authored-by: Patrick Mooney <pmooney@pfmooney.com> Co-authored-by: gitbot <git@bot> Co-authored-by: Michael Tautschnig <tautschn@amazon.com>
1 parent 64af8ce commit 5cf80a8

File tree

172 files changed

+3195
-1767
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+3195
-1767
lines changed

library/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/alloc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bench = false
1616

1717
[dependencies]
1818
core = { path = "../core", public = true }
19-
compiler_builtins = { version = "=0.1.152", features = ['rustc-dep-of-std'] }
19+
compiler_builtins = { version = "=0.1.155", features = ['rustc-dep-of-std'] }
2020
safety = { path = "../contracts/safety" }
2121

2222
[features]

library/alloc/src/alloc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ unsafe extern "Rust" {
1616
// otherwise.
1717
#[rustc_allocator]
1818
#[rustc_nounwind]
19-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
19+
#[rustc_std_internal_symbol]
2020
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
2121
#[rustc_deallocator]
2222
#[rustc_nounwind]
23-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
23+
#[rustc_std_internal_symbol]
2424
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
2525
#[rustc_reallocator]
2626
#[rustc_nounwind]
27-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
27+
#[rustc_std_internal_symbol]
2828
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
2929
#[rustc_allocator_zeroed]
3030
#[rustc_nounwind]
31-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
31+
#[rustc_std_internal_symbol]
3232
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
3333

34-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
34+
#[rustc_std_internal_symbol]
3535
static __rust_no_alloc_shim_is_unstable: u8;
3636
}
3737

@@ -360,7 +360,7 @@ unsafe extern "Rust" {
360360
// This is the magic symbol to call the global alloc error handler. rustc generates
361361
// it to call `__rg_oom` if there is a `#[alloc_error_handler]`, or to call the
362362
// default implementations below (`__rdl_oom`) otherwise.
363-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
363+
#[rustc_std_internal_symbol]
364364
fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
365365
}
366366

@@ -427,7 +427,7 @@ pub mod __alloc_error_handler {
427427
unsafe extern "Rust" {
428428
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
429429
// Its value depends on the -Zoom={panic,abort} compiler option.
430-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
430+
#[rustc_std_internal_symbol]
431431
static __rust_alloc_error_handler_should_panic: u8;
432432
}
433433

library/alloc/src/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
952952
/// assert_eq!(*x, i);
953953
/// }
954954
/// ```
955-
#[stable(feature = "box_uninit_write", since = "CURRENT_RUSTC_VERSION")]
955+
#[stable(feature = "box_uninit_write", since = "1.87.0")]
956956
#[inline]
957957
pub fn write(mut boxed: Self, value: T) -> Box<T, A> {
958958
unsafe {

library/alloc/src/collections/btree/set_val.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(super) struct SetValZST;
99
/// Returns `true` only for type `SetValZST`, `false` for all other types (blanket implementation).
1010
/// `TypeId` requires a `'static` lifetime, use of this trait avoids that restriction.
1111
///
12-
/// [`TypeId`]: std::any::TypeId
12+
/// [`TypeId`]: core::any::TypeId
1313
pub(super) trait IsSetVal {
1414
fn is_set_val() -> bool;
1515
}

library/alloc/src/collections/linked_list.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ impl<T, A: Allocator> LinkedList<T, A> {
11511151
/// assert_eq!(evens.into_iter().collect::<Vec<_>>(), vec![2, 4, 6, 8, 14]);
11521152
/// assert_eq!(odds.into_iter().collect::<Vec<_>>(), vec![1, 3, 5, 9, 11, 13, 15]);
11531153
/// ```
1154-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1154+
#[stable(feature = "extract_if", since = "1.87.0")]
11551155
pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
11561156
where
11571157
F: FnMut(&mut T) -> bool,
@@ -1931,7 +1931,7 @@ impl<'a, T, A: Allocator> CursorMut<'a, T, A> {
19311931
}
19321932

19331933
/// An iterator produced by calling `extract_if` on LinkedList.
1934-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1934+
#[stable(feature = "extract_if", since = "1.87.0")]
19351935
#[must_use = "iterators are lazy and do nothing unless consumed"]
19361936
pub struct ExtractIf<
19371937
'a,
@@ -1946,7 +1946,7 @@ pub struct ExtractIf<
19461946
old_len: usize,
19471947
}
19481948

1949-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1949+
#[stable(feature = "extract_if", since = "1.87.0")]
19501950
impl<T, F, A: Allocator> Iterator for ExtractIf<'_, T, F, A>
19511951
where
19521952
F: FnMut(&mut T) -> bool,
@@ -1975,7 +1975,7 @@ where
19751975
}
19761976
}
19771977

1978-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1978+
#[stable(feature = "extract_if", since = "1.87.0")]
19791979
impl<T: fmt::Debug, F> fmt::Debug for ExtractIf<'_, T, F> {
19801980
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19811981
f.debug_tuple("ExtractIf").field(&self.list).finish()

library/alloc/src/ffi/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ impl CStr {
11161116
/// with the corresponding <code>&[str]</code> slice. Otherwise, it will
11171117
/// replace any invalid UTF-8 sequences with
11181118
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
1119-
/// <code>[Cow]::[Owned]\(&[str])</code> with the result.
1119+
/// <code>[Cow]::[Owned]\([String])</code> with the result.
11201120
///
11211121
/// [str]: prim@str "str"
11221122
/// [Borrowed]: Cow::Borrowed

library/alloc/src/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
//! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These
110110
//! parameters affect the string representation of what's being formatted.
111111
//!
112-
//! The colon `:` in format syntax divides indentifier of the input data and
112+
//! The colon `:` in format syntax divides identifier of the input data and
113113
//! the formatting options, the colon itself does not change anything, only
114114
//! introduces the options.
115115
//!

library/alloc/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
#![feature(async_iterator)]
106106
#![feature(bstr)]
107107
#![feature(bstr_internals)]
108+
#![feature(char_internals)]
108109
#![feature(char_max_len)]
109110
#![feature(clone_to_uninit)]
110111
#![feature(coerce_unsized)]
@@ -136,6 +137,7 @@
136137
#![feature(pattern)]
137138
#![feature(pin_coerce_unsized_trait)]
138139
#![feature(pointer_like_trait)]
140+
#![feature(ptr_alignment_type)]
139141
#![feature(ptr_internals)]
140142
#![feature(ptr_metadata)]
141143
#![feature(set_ptr_value)]

library/alloc/src/raw_vec/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use core::marker::PhantomData;
88
use core::mem::{ManuallyDrop, MaybeUninit, SizedTypeProperties};
9-
use core::ptr::{self, NonNull, Unique};
9+
use core::ptr::{self, Alignment, NonNull, Unique};
1010
use core::{cmp, hint};
1111

1212
#[cfg(not(no_global_oom_handling))]
@@ -177,7 +177,7 @@ impl<T, A: Allocator> RawVec<T, A> {
177177
/// the returned `RawVec`.
178178
#[inline]
179179
pub(crate) const fn new_in(alloc: A) -> Self {
180-
Self { inner: RawVecInner::new_in(alloc, align_of::<T>()), _marker: PhantomData }
180+
Self { inner: RawVecInner::new_in(alloc, Alignment::of::<T>()), _marker: PhantomData }
181181
}
182182

183183
/// Like `with_capacity`, but parameterized over the choice of
@@ -409,8 +409,8 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec<T, A> {
409409

410410
impl<A: Allocator> RawVecInner<A> {
411411
#[inline]
412-
const fn new_in(alloc: A, align: usize) -> Self {
413-
let ptr = unsafe { core::mem::transmute(align) };
412+
const fn new_in(alloc: A, align: Alignment) -> Self {
413+
let ptr = Unique::from_non_null(NonNull::without_provenance(align.as_nonzero()));
414414
// `cap: 0` means "unallocated". zero-sized types are ignored.
415415
Self { ptr, cap: ZERO_CAP, alloc }
416416
}
@@ -465,7 +465,7 @@ impl<A: Allocator> RawVecInner<A> {
465465

466466
// Don't allocate here because `Drop` will not deallocate when `capacity` is 0.
467467
if layout.size() == 0 {
468-
return Ok(Self::new_in(alloc, elem_layout.align()));
468+
return Ok(Self::new_in(alloc, elem_layout.alignment()));
469469
}
470470

471471
if let Err(err) = alloc_guard(layout.size()) {

0 commit comments

Comments
 (0)