Skip to content

Commit 7e95740

Browse files
committed
Auto merge of rust-lang#79220 - Dylan-DPC:rollup-5bpbygd, r=Dylan-DPC
Rollup of 11 pull requests Successful merges: - rust-lang#79119 (Clarify availability of atomic operations) - rust-lang#79123 (Add u128 and i128 integer tests) - rust-lang#79177 (Test drop order for (destructuring) assignments) - rust-lang#79181 (rustdoc: add [src] links to methods on a trait's page) - rust-lang#79183 (Make compiletest testing use the local sysroot) - rust-lang#79185 (expand/resolve: Pre-requisites to "Turn `#[derive]` into a regular macro attribute") - rust-lang#79193 (Revert rust-lang#78969 "Normalize function type during validation") - rust-lang#79194 (Make as{_mut,}_slice on array::IntoIter public) - rust-lang#79204 (Add jyn514 email alias to mailmap) - rust-lang#79212 (Move `rustc_ty` -> `rustc_ty_utils`) - rust-lang#79217 (Add the "memcpy" doc alias to slice::copy_from_slice) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents f816695 + 59925a0 commit 7e95740

File tree

8 files changed

+25
-11
lines changed

8 files changed

+25
-11
lines changed

core/src/array/iter.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ impl<T, const N: usize> IntoIter<T, N> {
6969

7070
/// Returns an immutable slice of all elements that have not been yielded
7171
/// yet.
72-
fn as_slice(&self) -> &[T] {
72+
#[unstable(feature = "array_value_iter_slice", issue = "65798")]
73+
pub fn as_slice(&self) -> &[T] {
7374
// SAFETY: We know that all elements within `alive` are properly initialized.
7475
unsafe {
7576
let slice = self.data.get_unchecked(self.alive.clone());
@@ -78,7 +79,8 @@ impl<T, const N: usize> IntoIter<T, N> {
7879
}
7980

8081
/// Returns a mutable slice of all elements that have not been yielded yet.
81-
fn as_mut_slice(&mut self) -> &mut [T] {
82+
#[unstable(feature = "array_value_iter_slice", issue = "65798")]
83+
pub fn as_mut_slice(&mut self) -> &mut [T] {
8284
// SAFETY: We know that all elements within `alive` are properly initialized.
8385
unsafe {
8486
let slice = self.data.get_unchecked_mut(self.alive.clone());

core/src/slice/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,6 +2724,7 @@ impl<T> [T] {
27242724
///
27252725
/// [`clone_from_slice`]: #method.clone_from_slice
27262726
/// [`split_at_mut`]: #method.split_at_mut
2727+
#[doc(alias = "memcpy")]
27272728
#[stable(feature = "copy_from_slice", since = "1.9.0")]
27282729
pub fn copy_from_slice(&mut self, src: &[T])
27292730
where

core/src/sync/atomic.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@
4747
//!
4848
//! * PowerPC and MIPS platforms with 32-bit pointers do not have `AtomicU64` or
4949
//! `AtomicI64` types.
50-
//! * ARM platforms like `armv5te` that aren't for Linux do not have any atomics
51-
//! at all.
52-
//! * ARM targets with `thumbv6m` do not have atomic operations at all.
50+
//! * ARM platforms like `armv5te` that aren't for Linux only provide `load`
51+
//! and `store` operations, and do not support Compare and Swap (CAS)
52+
//! operations, such as `swap`, `fetch_add`, etc. Additionally on Linux,
53+
//! these CAS operations are implemented via [operating system support], which
54+
//! may come with a performance penalty.
55+
//! * ARM targets with `thumbv6m` only provide `load` and `store` operations,
56+
//! and do not support Compare and Swap (CAS) operations, such as `swap`,
57+
//! `fetch_add`, etc.
58+
//!
59+
//! [operating system support]: https://www.kernel.org/doc/Documentation/arm/kernel_user_helpers.txt
5360
//!
5461
//! Note that future platforms may be added that also do not have support for
5562
//! some atomic operations. Maximally portable code will want to be careful

core/tests/num/i128.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int_module!(i128, i128);

core/tests/num/int_macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ macro_rules! int_module {
131131
assert_eq!(B.rotate_left(0), B);
132132
assert_eq!(C.rotate_left(0), C);
133133
// Rotating by a multiple of word size should also have no effect
134-
assert_eq!(A.rotate_left(64), A);
135-
assert_eq!(B.rotate_left(64), B);
136-
assert_eq!(C.rotate_left(64), C);
134+
assert_eq!(A.rotate_left(128), A);
135+
assert_eq!(B.rotate_left(128), B);
136+
assert_eq!(C.rotate_left(128), C);
137137
}
138138

139139
#[test]

core/tests/num/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use core::str::FromStr;
1111
#[macro_use]
1212
mod int_macros;
1313

14+
mod i128;
1415
mod i16;
1516
mod i32;
1617
mod i64;
@@ -19,6 +20,7 @@ mod i8;
1920
#[macro_use]
2021
mod uint_macros;
2122

23+
mod u128;
2224
mod u16;
2325
mod u32;
2426
mod u64;

core/tests/num/u128.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uint_module!(u128, u128);

core/tests/num/uint_macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ macro_rules! uint_module {
9696
assert_eq!(B.rotate_left(0), B);
9797
assert_eq!(C.rotate_left(0), C);
9898
// Rotating by a multiple of word size should also have no effect
99-
assert_eq!(A.rotate_left(64), A);
100-
assert_eq!(B.rotate_left(64), B);
101-
assert_eq!(C.rotate_left(64), C);
99+
assert_eq!(A.rotate_left(128), A);
100+
assert_eq!(B.rotate_left(128), B);
101+
assert_eq!(C.rotate_left(128), C);
102102
}
103103

104104
#[test]

0 commit comments

Comments
 (0)