Skip to content

Commit 75bf5ce

Browse files
github-actions[bot]matthiaskrgrfrank-kingm-ou-sedanielhenrymantilla
authored
Merge subtree update for toolchain nightly-2025-04-23 (model-checking#340)
This is an automated PR to merge library subtree updates from 2025-04-21 (rust-lang/rust@b8c54d6) to 2025-04-23 (rust-lang/rust@6bc57c6), inclusive. This is a clean merge, no conflicts were detected. **Do not remove or edit the following annotations:** git-subtree-dir: library git-subtree-split: 54a7b4f --------- 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: Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> Co-authored-by: Frank King <frankking1729@gmail.com> Co-authored-by: Mara Bos <m-ou.se@m-ou.se> Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com> Co-authored-by: Scott McMurray <scottmcm@users.noreply.github.com> Co-authored-by: joboet <jonasboettiger@icloud.com> Co-authored-by: Chris Denton <chris@chrisdenton.dev> Co-authored-by: bors <bors@rust-lang.org> Co-authored-by: mejrs <59372212+mejrs@users.noreply.github.com> Co-authored-by: okaneco <47607823+okaneco@users.noreply.github.com> Co-authored-by: Jacob Pratt <jacob@jhpratt.dev> Co-authored-by: xizheyin <xizheyin@smail.nju.edu.cn> Co-authored-by: Benoît du Garreau <benoit@dugarreau.fr> 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: Ralf Jung <post@ralfj.de> 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: Thalia Archibald <thalia@archibald.dev> 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: Jethro Beekman <jethro@fortanix.com> 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: Kent Ross <k@mad.cash> Co-authored-by: Noa <coolreader18@gmail.com> Co-authored-by: Lieselotte <52315535+she3py@users.noreply.github.com> Co-authored-by: Patrick Mooney <pmooney@pfmooney.com> Co-authored-by: Onè <43485962+c-git@users.noreply.github.com> Co-authored-by: 王宇逸 <Strawberry_Str@hotmail.com> Co-authored-by: gitbot <git@bot>
1 parent 5cf80a8 commit 75bf5ce

File tree

25 files changed

+57
-77
lines changed

25 files changed

+57
-77
lines changed

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/ffi/c_str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl CString {
574574
#[stable(feature = "as_c_str", since = "1.20.0")]
575575
#[rustc_diagnostic_item = "cstring_as_c_str"]
576576
pub fn as_c_str(&self) -> &CStr {
577-
&*self
577+
unsafe { CStr::from_bytes_with_nul_unchecked(self.as_bytes_with_nul()) }
578578
}
579579

580580
/// Converts this `CString` into a boxed [`CStr`].
@@ -705,14 +705,14 @@ impl ops::Deref for CString {
705705

706706
#[inline]
707707
fn deref(&self) -> &CStr {
708-
unsafe { CStr::from_bytes_with_nul_unchecked(self.as_bytes_with_nul()) }
708+
self.as_c_str()
709709
}
710710
}
711711

712712
#[stable(feature = "rust1", since = "1.0.0")]
713713
impl fmt::Debug for CString {
714714
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
715-
fmt::Debug::fmt(&**self, f)
715+
fmt::Debug::fmt(self.as_c_str(), f)
716716
}
717717
}
718718

library/alloctests/tests/c_str2.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ fn build_with_zero2() {
3333
assert!(CString::new(vec![0]).is_err());
3434
}
3535

36-
#[test]
37-
fn formatted() {
38-
let s = CString::new(&b"abc\x01\x02\n\xE2\x80\xA6\xFF"[..]).unwrap();
39-
assert_eq!(format!("{s:?}"), r#""abc\x01\x02\n\xe2\x80\xa6\xff""#);
40-
}
41-
4236
#[test]
4337
fn borrowed() {
4438
unsafe {

library/core/src/any.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,8 @@ impl hash::Hash for TypeId {
772772
// (especially given the previous point about the lower 64 bits being
773773
// high quality on their own).
774774
// - It is correct to do so -- only hashing a subset of `self` is still
775-
// with an `Eq` implementation that considers the entire value, as
776-
// ours does.
775+
// compatible with an `Eq` implementation that considers the entire
776+
// value, as ours does.
777777
self.t.1.hash(state);
778778
}
779779
}

library/core/src/arch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
3232
///
3333
/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
3434
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
35-
#[unstable(feature = "naked_functions", issue = "90957")]
35+
#[stable(feature = "naked_functions", since = "CURRENT_RUSTC_VERSION")]
3636
#[rustc_builtin_macro]
3737
pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) {
3838
/* compiler built-in */

library/core/src/bstr/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ use crate::ops::{Deref, DerefMut, DerefPure};
3636
/// presented as hex escape sequences.
3737
///
3838
/// The `Display` implementation behaves as if the `ByteStr` were first lossily converted to a
39-
/// `str`, with invalid UTF-8 presented as the Unicode replacement character: �
40-
///
39+
/// `str`, with invalid UTF-8 presented as the Unicode replacement character (�).
4140
#[unstable(feature = "bstr", issue = "134915")]
4241
#[repr(transparent)]
4342
#[doc(alias = "BStr")]

library/core/src/ffi/c_str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ impl Error for FromBytesWithNulError {
157157
/// within the slice.
158158
///
159159
/// This error is created by the [`CStr::from_bytes_until_nul`] method.
160-
///
161160
#[derive(Clone, PartialEq, Eq, Debug)]
162161
#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
163162
pub struct FromBytesUntilNulError(());

library/core/src/intrinsics/simd.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ pub unsafe fn simd_shuffle<T, U, V>(x: T, y: T, idx: U) -> V;
304304
///
305305
/// `U` must be a vector of pointers to the element type of `T`, with the same length as `T`.
306306
///
307-
/// `V` must be a vector of signed integers with the same length as `T` (but any element size).
307+
/// `V` must be a vector of integers with the same length as `T` (but any element size).
308308
///
309309
/// For each pointer in `ptr`, if the corresponding value in `mask` is `!0`, read the pointer.
310310
/// Otherwise if the corresponding value in `mask` is `0`, return the corresponding value from
@@ -325,7 +325,7 @@ pub unsafe fn simd_gather<T, U, V>(val: T, ptr: U, mask: V) -> T;
325325
///
326326
/// `U` must be a vector of pointers to the element type of `T`, with the same length as `T`.
327327
///
328-
/// `V` must be a vector of signed integers with the same length as `T` (but any element size).
328+
/// `V` must be a vector of integers with the same length as `T` (but any element size).
329329
///
330330
/// For each pointer in `ptr`, if the corresponding value in `mask` is `!0`, write the
331331
/// corresponding value in `val` to the pointer.
@@ -349,7 +349,7 @@ pub unsafe fn simd_scatter<T, U, V>(val: T, ptr: U, mask: V);
349349
///
350350
/// `U` must be a pointer to the element type of `T`
351351
///
352-
/// `V` must be a vector of signed integers with the same length as `T` (but any element size).
352+
/// `V` must be a vector of integers with the same length as `T` (but any element size).
353353
///
354354
/// For each element, if the corresponding value in `mask` is `!0`, read the corresponding
355355
/// pointer offset from `ptr`.
@@ -372,7 +372,7 @@ pub unsafe fn simd_masked_load<V, U, T>(mask: V, ptr: U, val: T) -> T;
372372
///
373373
/// `U` must be a pointer to the element type of `T`
374374
///
375-
/// `V` must be a vector of signed integers with the same length as `T` (but any element size).
375+
/// `V` must be a vector of integers with the same length as `T` (but any element size).
376376
///
377377
/// For each element, if the corresponding value in `mask` is `!0`, write the corresponding
378378
/// value in `val` to the pointer offset from `ptr`.
@@ -556,7 +556,7 @@ pub unsafe fn simd_bitmask<T, U>(x: T) -> U;
556556
///
557557
/// `T` must be a vector.
558558
///
559-
/// `M` must be a signed integer vector with the same length as `T` (but any element size).
559+
/// `M` must be an integer vector with the same length as `T` (but any element size).
560560
///
561561
/// For each element, if the corresponding value in `mask` is `!0`, select the element from
562562
/// `if_true`. If the corresponding value in `mask` is `0`, select the element from

library/core/src/slice/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2814,7 +2814,7 @@ impl<T> [T] {
28142814
let half = size / 2;
28152815
let mid = base + half;
28162816

2817-
// SAFETY: the call is made safe by the following inconstants:
2817+
// SAFETY: the call is made safe by the following invariants:
28182818
// - `mid >= 0`: by definition
28192819
// - `mid < size`: `mid = size / 2 + size / 4 + size / 8 ...`
28202820
let cmp = f(unsafe { self.get_unchecked(mid) });

library/coretests/tests/ffi/cstr.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ fn compares_as_u8s() {
1313
assert_eq!(Ord::cmp(a, b), Ord::cmp(a_bytes, b_bytes));
1414
assert_eq!(PartialOrd::partial_cmp(a, b), PartialOrd::partial_cmp(a_bytes, b_bytes));
1515
}
16+
17+
#[test]
18+
fn debug() {
19+
let s = c"abc\x01\x02\n\xE2\x80\xA6\xFF";
20+
assert_eq!(format!("{s:?}"), r#""abc\x01\x02\n\xe2\x80\xa6\xff""#);
21+
}

0 commit comments

Comments
 (0)