Skip to content

Commit 71c5bf3

Browse files
github-actions[bot]hkBstoli-obkRalfJungmatthiaskrgr
authored
Merge subtree update for toolchain nightly-2025-07-21 (#428)
This is an automated PR to merge library subtree updates from 2025-07-14 (rust-lang/rust@e9182f1) to 2025-07-21 (rust-lang/rust@9982d64) (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: 62f8613 --------- Signed-off-by: Ayush Singh <[email protected]> Signed-off-by: xizheyin <[email protected]> Signed-off-by: Huang Qi <[email protected]> Co-authored-by: Marijn Schouten <[email protected]> Co-authored-by: Oli Scherer <[email protected]> Co-authored-by: Ralf Jung <[email protected]> Co-authored-by: Matthias Krüger <[email protected]> Co-authored-by: наб <[email protected]> Co-authored-by: bors <[email protected]> Co-authored-by: klensy <[email protected]> Co-authored-by: Folkert de Vries <[email protected]> Co-authored-by: clubby789 <[email protected]> Co-authored-by: Tsukasa OI <[email protected]> Co-authored-by: Jana Dönszelmann <[email protected]> Co-authored-by: Deadbeef <[email protected]> Co-authored-by: Guillaume Gomez <[email protected]> Co-authored-by: Daniel Paoliello <[email protected]> Co-authored-by: Urgau <[email protected]> Co-authored-by: Michael Goulet <[email protected]> Co-authored-by: Jacob Pratt <[email protected]> Co-authored-by: The Miri Cronjob Bot <[email protected]> Co-authored-by: Ayush Singh <[email protected]> Co-authored-by: Trevor Gross <[email protected]> Co-authored-by: Kurt Heiritz (pseudo) <[email protected]> Co-authored-by: Jubilee <[email protected]> Co-authored-by: Ben Kimock <[email protected]> Co-authored-by: Joshua Gentry <[email protected]> Co-authored-by: dvdsk <[email protected]> Co-authored-by: Yotam Ofek <[email protected]> Co-authored-by: Simonas Kazlauskas <[email protected]> Co-authored-by: xizheyin <[email protected]> Co-authored-by: 许杰友 Jieyou Xu (Joe) <[email protected]> Co-authored-by: Chris Denton <[email protected]> Co-authored-by: Md. Yeasin Arafat <[email protected]> Co-authored-by: mejrs <[email protected]> Co-authored-by: Jakub Beránek <[email protected]> Co-authored-by: Amanieu d'Antras <[email protected]> Co-authored-by: ltdk <[email protected]> Co-authored-by: okaneco <[email protected]> Co-authored-by: kilavvy <[email protected]> Co-authored-by: Pavel Grigorenko <[email protected]> Co-authored-by: Esteban Küber <[email protected]> Co-authored-by: sayantn <[email protected]> Co-authored-by: George Tokmaji <[email protected]> Co-authored-by: Moulins <[email protected]> Co-authored-by: Josh Stone <[email protected]> Co-authored-by: Trevor Gross <[email protected]> Co-authored-by: B I Mohammed Abbas <[email protected]> Co-authored-by: Benoît du Garreau <[email protected]> Co-authored-by: Josh Triplett <[email protected]> Co-authored-by: yukang <[email protected]> Co-authored-by: Roger Curley <[email protected]> Co-authored-by: LevitatingBusinessMan (Rein Fernhout) <[email protected]> Co-authored-by: Harvey Hunt <[email protected]> Co-authored-by: Colten <[email protected]> Co-authored-by: Huang Qi <[email protected]> Co-authored-by: nazo6 <[email protected]> Co-authored-by: León Orell Valerian Liehr <[email protected]> Co-authored-by: Orson Peters <[email protected]> Co-authored-by: René Kijewski <[email protected]> Co-authored-by: Nik Revenco <[email protected]> Co-authored-by: Tim (Theemathas) Chirananthavat <[email protected]> Co-authored-by: Samuel Tardieu <[email protected]> Co-authored-by: Travis Cross <[email protected]> Co-authored-by: David Mládek <[email protected]> Co-authored-by: Cameron Steffen <[email protected]> Co-authored-by: Martin Ombura Jr <[email protected]> Co-authored-by: Luigi Sartor Piucco <[email protected]> Co-authored-by: Rémy Rakic <[email protected]> Co-authored-by: Nurzhan Sakén <[email protected]> Co-authored-by: gitbot <git@bot> Co-authored-by: Michael Tautschnig <[email protected]>
1 parent 4c08921 commit 71c5bf3

Some content is hidden

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

89 files changed

+1211
-1415
lines changed

.github/workflows/flux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
FIXPOINT_VERSION: "556104ba5508891c357b0bdf819ce706e93d9349"
12-
FLUX_VERSION: "f6bdf90c54ad6eed51b25c125f251cac01cfe170"
12+
FLUX_VERSION: "ebafb8d0ca32d8c0fcd2a0cfef6b1b4bd4dc4a6f"
1313

1414
jobs:
1515
check-flux-on-core:

library/Cargo.lock

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

library/alloc/src/boxed/thin.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use core::error::Error;
66
use core::fmt::{self, Debug, Display, Formatter};
77
#[cfg(not(no_global_oom_handling))]
8-
use core::intrinsics::const_allocate;
8+
use core::intrinsics::{const_allocate, const_make_global};
99
use core::marker::PhantomData;
1010
#[cfg(not(no_global_oom_handling))]
1111
use core::marker::Unsize;
@@ -340,9 +340,10 @@ impl<H> WithHeader<H> {
340340
alloc.add(metadata_offset).cast();
341341
// SAFETY: `*metadata_ptr` is within the allocation.
342342
metadata_ptr.write(ptr::metadata::<Dyn>(ptr::dangling::<T>() as *const Dyn));
343-
343+
// SAFETY: valid heap allocation
344+
const_make_global(alloc);
344345
// SAFETY: we have just written the metadata.
345-
&*(metadata_ptr)
346+
&*metadata_ptr
346347
}
347348
};
348349

library/alloc/src/fmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@
348348
//! format := '{' [ argument ] [ ':' format_spec ] [ ws ] * '}'
349349
//! argument := integer | identifier
350350
//!
351-
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision]type
351+
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision][type]
352352
//! fill := character
353353
//! align := '<' | '^' | '>'
354354
//! sign := '+' | '-'
355355
//! width := count
356356
//! precision := count | '*'
357-
//! type := '' | '?' | 'x?' | 'X?' | identifier
357+
//! type := '?' | 'x?' | 'X?' | identifier
358358
//! count := parameter | integer
359359
//! parameter := argument '$'
360360
//! ```

library/alloc/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
#![feature(try_trait_v2)]
157157
#![feature(try_with_capacity)]
158158
#![feature(tuple_trait)]
159+
#![feature(ub_checks)]
159160
#![feature(unicode_internals)]
160161
#![feature(unsize)]
161162
#![feature(unwrap_infallible)]

library/alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,7 @@ impl_eq! { Cow<'a, str>, &'b str }
26112611
impl_eq! { Cow<'a, str>, String }
26122612

26132613
#[stable(feature = "rust1", since = "1.0.0")]
2614-
#[rustc_const_unstable(feature = "const_default", issue = "67792")]
2614+
#[rustc_const_unstable(feature = "const_default", issue = "143894")]
26152615
impl const Default for String {
26162616
/// Creates an empty `String`.
26172617
#[inline]

library/alloc/src/vec/mod.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties};
6464
use core::ops::{self, Index, IndexMut, Range, RangeBounds};
6565
use core::ptr::{self, NonNull};
6666
use core::slice::{self, SliceIndex};
67-
use core::{fmt, intrinsics};
67+
use core::{fmt, intrinsics, ub_checks};
6868

6969
#[stable(feature = "extract_if", since = "1.87.0")]
7070
pub use self::extract_if::ExtractIf;
@@ -1058,6 +1058,11 @@ impl<T, A: Allocator> Vec<T, A> {
10581058
#[inline]
10591059
#[unstable(feature = "allocator_api", issue = "32838")]
10601060
pub unsafe fn from_raw_parts_in(ptr: *mut T, length: usize, capacity: usize, alloc: A) -> Self {
1061+
ub_checks::assert_unsafe_precondition!(
1062+
check_library_ub,
1063+
"Vec::from_raw_parts_in requires that length <= capacity",
1064+
(length: usize = length, capacity: usize = capacity) => length <= capacity
1065+
);
10611066
unsafe { Vec { buf: RawVec::from_raw_parts_in(ptr, capacity, alloc), len: length } }
10621067
}
10631068

@@ -1174,6 +1179,11 @@ impl<T, A: Allocator> Vec<T, A> {
11741179
#[unstable(feature = "allocator_api", reason = "new API", issue = "32838")]
11751180
// #[unstable(feature = "box_vec_non_null", issue = "130364")]
11761181
pub unsafe fn from_parts_in(ptr: NonNull<T>, length: usize, capacity: usize, alloc: A) -> Self {
1182+
ub_checks::assert_unsafe_precondition!(
1183+
check_library_ub,
1184+
"Vec::from_parts_in requires that length <= capacity",
1185+
(length: usize = length, capacity: usize = capacity) => length <= capacity
1186+
);
11771187
unsafe { Vec { buf: RawVec::from_nonnull_in(ptr, capacity, alloc), len: length } }
11781188
}
11791189

@@ -1950,7 +1960,11 @@ impl<T, A: Allocator> Vec<T, A> {
19501960
#[inline]
19511961
#[stable(feature = "rust1", since = "1.0.0")]
19521962
pub unsafe fn set_len(&mut self, new_len: usize) {
1953-
debug_assert!(new_len <= self.capacity());
1963+
ub_checks::assert_unsafe_precondition!(
1964+
check_library_ub,
1965+
"Vec::set_len requires that new_len <= capacity()",
1966+
(new_len: usize = new_len, capacity: usize = self.capacity()) => new_len <= capacity
1967+
);
19541968

19551969
self.len = new_len;
19561970
}
@@ -3695,7 +3709,7 @@ impl<T, A: Allocator> Vec<T, A> {
36953709
/// This is optimal if:
36963710
///
36973711
/// * The tail (elements in the vector after `range`) is empty,
3698-
/// * or `replace_with` yields fewer or equal elements than `range`s length
3712+
/// * or `replace_with` yields fewer or equal elements than `range`'s length
36993713
/// * or the lower bound of its `size_hint()` is exact.
37003714
///
37013715
/// Otherwise, a temporary vector is allocated and the tail is moved twice.
@@ -3895,7 +3909,7 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for Vec<T, A> {
38953909
}
38963910

38973911
#[stable(feature = "rust1", since = "1.0.0")]
3898-
#[rustc_const_unstable(feature = "const_default", issue = "67792")]
3912+
#[rustc_const_unstable(feature = "const_default", issue = "143894")]
38993913
impl<T> const Default for Vec<T> {
39003914
/// Creates an empty `Vec<T>`.
39013915
///

library/core/src/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ impl TypeId {
783783

784784
// This is a provenance-stripping memcpy.
785785
for (i, chunk) in self.data.iter().copied().enumerate() {
786-
let chunk = chunk.expose_provenance().to_ne_bytes();
786+
let chunk = chunk.addr().to_ne_bytes();
787787
let start = i * chunk.len();
788788
bytes[start..(start + chunk.len())].copy_from_slice(&chunk);
789789
}

library/core/src/array/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,10 @@ impl<'a, T, const N: usize> IntoIterator for &'a mut [T; N] {
374374
}
375375

376376
#[stable(feature = "index_trait_on_arrays", since = "1.50.0")]
377-
impl<T, I, const N: usize> Index<I> for [T; N]
377+
#[rustc_const_unstable(feature = "const_index", issue = "143775")]
378+
impl<T, I, const N: usize> const Index<I> for [T; N]
378379
where
379-
[T]: Index<I>,
380+
[T]: ~const Index<I>,
380381
{
381382
type Output = <[T] as Index<I>>::Output;
382383

@@ -387,9 +388,10 @@ where
387388
}
388389

389390
#[stable(feature = "index_trait_on_arrays", since = "1.50.0")]
390-
impl<T, I, const N: usize> IndexMut<I> for [T; N]
391+
#[rustc_const_unstable(feature = "const_index", issue = "143775")]
392+
impl<T, I, const N: usize> const IndexMut<I> for [T; N]
391393
where
392-
[T]: IndexMut<I>,
394+
[T]: ~const IndexMut<I>,
393395
{
394396
#[inline]
395397
fn index_mut(&mut self, index: I) -> &mut Self::Output {

library/core/src/async_iter/async_iter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ pub trait AsyncIterator {
2828
/// async iterator state:
2929
///
3030
/// - `Poll::Pending` means that this async iterator's next value is not ready
31-
/// yet. Implementations will ensure that the current task will be notified
32-
/// when the next value may be ready.
31+
/// yet. Implementations will ensure that the current task will be notified
32+
/// when the next value may be ready.
3333
///
3434
/// - `Poll::Ready(Some(val))` means that the async iterator has successfully
35-
/// produced a value, `val`, and may produce further values on subsequent
36-
/// `poll_next` calls.
35+
/// produced a value, `val`, and may produce further values on subsequent
36+
/// `poll_next` calls.
3737
///
3838
/// - `Poll::Ready(None)` means that the async iterator has terminated, and
39-
/// `poll_next` should not be invoked again.
39+
/// `poll_next` should not be invoked again.
4040
///
4141
/// # Panics
4242
///

0 commit comments

Comments
 (0)