Skip to content

Commit 2b55e03

Browse files
Merge pull request rust-lang#353 from rust-lang/sync-upstream-2023-06-07
Sync upstream
2 parents 73d7eb5 + eb0041d commit 2b55e03

File tree

10 files changed

+16
-12
lines changed

10 files changed

+16
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
2+
resolver = "1"
33
members = [
44
"crates/core_simd",
55
"crates/std_float",

crates/core_simd/examples/nbody.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ mod tests {
187187
fn main() {
188188
{
189189
let (energy_before, energy_after) = nbody::run(1000);
190-
println!("Energy before: {}", energy_before);
191-
println!("Energy after: {}", energy_after);
190+
println!("Energy before: {energy_before}");
191+
println!("Energy after: {energy_after}");
192192
}
193193
}

crates/core_simd/examples/spectral_norm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn dot(x: &[f64], y: &[f64]) -> f64 {
6969
#[cfg(test)]
7070
#[test]
7171
fn test() {
72-
assert_eq!(&format!("{:.9}", spectral_norm(100)), "1.274219991");
72+
assert_eq!(format!("{:.9}", spectral_norm(100)), "1.274219991");
7373
}
7474

7575
fn main() {

crates/core_simd/src/intrinsics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ extern "platform-intrinsic" {
6868
pub(crate) fn simd_cast<T, U>(x: T) -> U;
6969
/// follows Rust's `T as U` semantics, including saturating float casts
7070
/// which amounts to the same as `simd_cast` for many cases
71-
#[cfg(not(bootstrap))]
7271
pub(crate) fn simd_as<T, U>(x: T) -> U;
7372

7473
/// neg/fneg
@@ -101,7 +100,7 @@ extern "platform-intrinsic" {
101100
/// val: vector of values to select if a lane is masked
102101
/// ptr: vector of pointers to read from
103102
/// mask: a "wide" mask of integers, selects as if simd_select(mask, read(ptr), val)
104-
/// note, the LLVM intrinsic accepts a mask vector of <N x i1>
103+
/// note, the LLVM intrinsic accepts a mask vector of `<N x i1>`
105104
/// FIXME: review this if/when we fix up our mask story in general?
106105
pub(crate) fn simd_gather<T, U, V>(val: T, ptr: U, mask: V) -> T;
107106
/// llvm.masked.scatter

crates/core_simd/src/masks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl_element! { isize }
8888
/// The layout of this type is unspecified, and may change between platforms
8989
/// and/or Rust versions, and code should not assume that it is equivalent to
9090
/// `[T; LANES]`.
91-
#[repr(transparent)]
91+
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
9292
pub struct Mask<T, const LANES: usize>(mask_impl::Mask<T, LANES>)
9393
where
9494
T: MaskElement,

crates/core_simd/src/masks/full_masks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ where
260260
}
261261
}
262262

263-
impl<T, const LANES: usize> core::convert::From<Mask<T, LANES>> for Simd<T, LANES>
263+
impl<T, const LANES: usize> From<Mask<T, LANES>> for Simd<T, LANES>
264264
where
265265
T: MaskElement,
266266
LaneCount<LANES>: SupportedLaneCount,

crates/core_simd/src/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ macro_rules! unsafe_base {
4242

4343
/// SAFETY: This macro should not be used for anything except Shl or Shr, and passed the appropriate shift intrinsic.
4444
/// It handles performing a bitand in addition to calling the shift operator, so that the result
45-
/// is well-defined: LLVM can return a poison value if you shl, lshr, or ashr if rhs >= <Int>::BITS
45+
/// is well-defined: LLVM can return a poison value if you shl, lshr, or ashr if `rhs >= <Int>::BITS`
4646
/// At worst, this will maybe add another instruction and cycle,
4747
/// at best, it may open up more optimization opportunities,
4848
/// or simply be elided entirely, especially for SIMD ISAs which default to this.

crates/core_simd/src/ops/deref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ macro_rules! deref_ops {
7171

7272
#[inline]
7373
#[must_use = "operator returns a new vector without mutating the inputs"]
74-
fn $call(self, rhs: &$simd) -> Self::Output {
74+
fn $call(self, rhs: &'rhs $simd) -> Self::Output {
7575
(*self).$call(*rhs)
7676
}
7777
}

crates/core_simd/src/swizzle_dyn.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ where
1818
#![allow(unused_imports, unused_unsafe)]
1919
#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
2020
use core::arch::aarch64::{uint8x8_t, vqtbl1q_u8, vtbl1_u8};
21-
#[cfg(all(target_arch = "arm", target_feature = "v7", target_endian = "little"))]
21+
#[cfg(all(
22+
target_arch = "arm",
23+
target_feature = "v7",
24+
target_feature = "neon",
25+
target_endian = "little"
26+
))]
2227
use core::arch::arm::{uint8x8_t, vtbl1_u8};
2328
#[cfg(target_arch = "wasm32")]
2429
use core::arch::wasm32 as wasm;

crates/core_simd/src/vector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use core::convert::{TryFrom, TryInto};
2525
/// let sum = array::from_fn(|i| a[i] + b[i]);
2626
/// let prod = array::from_fn(|i| a[i] * b[i]);
2727
///
28-
/// // `Simd<T, N>` implements `From<[T; N]>
28+
/// // `Simd<T, N>` implements `From<[T; N]>`
2929
/// let (v, w) = (Simd::from(a), Simd::from(b));
3030
/// // Which means arrays implement `Into<Simd<T, N>>`.
3131
/// assert_eq!(v + w, sum.into());

0 commit comments

Comments
 (0)