Skip to content

Commit f19866c

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents 07c76e5 + 54a7b4f commit f19866c

File tree

49 files changed

+252
-265
lines changed

Some content is hidden

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

49 files changed

+252
-265
lines changed

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.

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

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 {

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
}

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 */

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")]

core/src/ffi/c_str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ impl Error for FromBytesWithNulError {
150150
/// within the slice.
151151
///
152152
/// This error is created by the [`CStr::from_bytes_until_nul`] method.
153-
///
154153
#[derive(Clone, PartialEq, Eq, Debug)]
155154
#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
156155
pub struct FromBytesUntilNulError(());

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

core/src/primitive_docs.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,10 +1307,12 @@ mod prim_f16 {}
13071307
// FIXME: Is there a better place to put this?
13081308
///
13091309
/// | `target_arch` | Extra payloads possible on this platform |
1310-
/// |---------------|---------|
1311-
/// | `x86`, `x86_64`, `arm`, `aarch64`, `riscv32`, `riscv64` | None |
1310+
/// |---------------|------------------------------------------|
1311+
// Sorted alphabetically
1312+
/// | `aarch64`, `arm`, `arm64ec`, `loongarch64`, `powerpc` (except when `target_abi = "spe"`), `powerpc64`, `riscv32`, `riscv64`, `s390x`, `x86`, `x86_64` | None |
1313+
/// | `nvptx64` | All payloads |
13121314
/// | `sparc`, `sparc64` | The all-one payload |
1313-
/// | `wasm32`, `wasm64` | If all input NaNs are quiet with all-zero payload: None.<br> Otherwise: all possible payloads. |
1315+
/// | `wasm32`, `wasm64` | If all input NaNs are quiet with all-zero payload: None.<br> Otherwise: all payloads. |
13141316
///
13151317
/// For targets not in this table, all payloads are possible.
13161318
///

core/src/slice/mod.rs

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

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

0 commit comments

Comments
 (0)