Skip to content

Commit f2bae99

Browse files
committed
Auto merge of #148425 - matthiaskrgr:rollup-pwibmxt, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - #146260 (add SliceIndex wrapper types Last and Clamp<Idx>) - #148394 (Make explicit that `TypeId`'s layout and size are unstable) - #148402 (stdarch subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7878a91 + 5f4a90e commit f2bae99

Some content is hidden

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

82 files changed

+14769
-2105
lines changed

library/core/src/any.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,15 @@ impl dyn Any + Send + Sync {
611611
/// noting that the hashes and ordering will vary between Rust releases. Beware
612612
/// of relying on them inside of your code!
613613
///
614+
/// # Layout
615+
///
616+
/// Like other [`Rust`-representation][repr-rust] types, `TypeId`'s size and layout are unstable.
617+
/// In particular, this means that you cannot rely on the size and layout of `TypeId` remaining the
618+
/// same between Rust releases; they are subject to change without prior notice between Rust
619+
/// releases.
620+
///
621+
/// [repr-rust]: https://doc.rust-lang.org/reference/type-layout.html#r-layout.repr.rust.unspecified
622+
///
614623
/// # Danger of Improper Variance
615624
///
616625
/// You might think that subtyping is impossible between two static types,

library/core/src/hint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ pub fn spin_loop() {
271271
crate::cfg_select! {
272272
target_arch = "x86" => {
273273
// SAFETY: the `cfg` attr ensures that we only execute this on x86 targets.
274-
unsafe { crate::arch::x86::_mm_pause() }
274+
crate::arch::x86::_mm_pause()
275275
}
276276
target_arch = "x86_64" => {
277277
// SAFETY: the `cfg` attr ensures that we only execute this on x86_64 targets.
278-
unsafe { crate::arch::x86_64::_mm_pause() }
278+
crate::arch::x86_64::_mm_pause()
279279
}
280280
target_arch = "riscv32" => crate::arch::riscv32::pause(),
281281
target_arch = "riscv64" => crate::arch::riscv64::pause(),

0 commit comments

Comments
 (0)