From f8aa494c69d2298e9f2b995eb07d279005f3fc40 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 20 Jul 2022 18:08:14 -0700 Subject: [PATCH] Introduce core::simd trait imports in tests --- library/core/src/slice/mod.rs | 1 + library/core/tests/simd.rs | 1 + src/test/codegen/simd-wide-sum.rs | 2 +- src/test/ui/simd/libm_no_std_cant_float.rs | 1 + src/test/ui/simd/libm_no_std_cant_float.stderr | 12 ++++++------ src/test/ui/simd/libm_std_can_float.rs | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 77fd1ec2b8e..6d9e58822c0 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -3569,6 +3569,7 @@ pub unsafe fn align_to_mut(&mut self) -> (&mut [T], &mut [U], &mut [T]) { /// /// ``` /// #![feature(portable_simd)] + /// use core::simd::SimdFloat; /// /// let short = &[1, 2, 3]; /// let (prefix, middle, suffix) = short.as_simd::<4>(); diff --git a/library/core/tests/simd.rs b/library/core/tests/simd.rs index 5b516a72360..565c8975eb9 100644 --- a/library/core/tests/simd.rs +++ b/library/core/tests/simd.rs @@ -1,4 +1,5 @@ use core::simd::f32x4; +use core::simd::SimdFloat; #[test] fn testing() { diff --git a/src/test/codegen/simd-wide-sum.rs b/src/test/codegen/simd-wide-sum.rs index 015ac4fe4d1..04314dc291a 100644 --- a/src/test/codegen/simd-wide-sum.rs +++ b/src/test/codegen/simd-wide-sum.rs @@ -5,7 +5,7 @@ #![crate_type = "lib"] #![feature(portable_simd)] -use std::simd::Simd; +use std::simd::{Simd, SimdUint}; const N: usize = 8; #[no_mangle] diff --git a/src/test/ui/simd/libm_no_std_cant_float.rs b/src/test/ui/simd/libm_no_std_cant_float.rs index abe460a326b..50ac8e20839 100644 --- a/src/test/ui/simd/libm_no_std_cant_float.rs +++ b/src/test/ui/simd/libm_no_std_cant_float.rs @@ -2,6 +2,7 @@ #![no_std] #![feature(portable_simd)] use core::simd::f32x4; +use core::simd::SimdFloat; // For SIMD float ops, the LLIR version which is used to implement the portable // forms of them may become calls to math.h AKA libm. So, we can't guarantee diff --git a/src/test/ui/simd/libm_no_std_cant_float.stderr b/src/test/ui/simd/libm_no_std_cant_float.stderr index dc8638f6ab7..b4ae57eb74e 100644 --- a/src/test/ui/simd/libm_no_std_cant_float.stderr +++ b/src/test/ui/simd/libm_no_std_cant_float.stderr @@ -1,35 +1,35 @@ error[E0599]: no method named `ceil` found for struct `Simd` in the current scope - --> $DIR/libm_no_std_cant_float.rs:14:17 + --> $DIR/libm_no_std_cant_float.rs:15:17 | LL | let _xc = x.ceil(); | ^^^^ method not found in `Simd` error[E0599]: no method named `floor` found for struct `Simd` in the current scope - --> $DIR/libm_no_std_cant_float.rs:15:17 + --> $DIR/libm_no_std_cant_float.rs:16:17 | LL | let _xf = x.floor(); | ^^^^^ method not found in `Simd` error[E0599]: no method named `round` found for struct `Simd` in the current scope - --> $DIR/libm_no_std_cant_float.rs:16:17 + --> $DIR/libm_no_std_cant_float.rs:17:17 | LL | let _xr = x.round(); | ^^^^^ method not found in `Simd` error[E0599]: no method named `trunc` found for struct `Simd` in the current scope - --> $DIR/libm_no_std_cant_float.rs:17:17 + --> $DIR/libm_no_std_cant_float.rs:18:17 | LL | let _xt = x.trunc(); | ^^^^^ method not found in `Simd` error[E0599]: no method named `mul_add` found for struct `Simd` in the current scope - --> $DIR/libm_no_std_cant_float.rs:18:19 + --> $DIR/libm_no_std_cant_float.rs:19:19 | LL | let _xfma = x.mul_add(x, x); | ^^^^^^^ method not found in `Simd` error[E0599]: no method named `sqrt` found for struct `Simd` in the current scope - --> $DIR/libm_no_std_cant_float.rs:19:20 + --> $DIR/libm_no_std_cant_float.rs:20:20 | LL | let _xsqrt = x.sqrt(); | ^^^^ method not found in `Simd` diff --git a/src/test/ui/simd/libm_std_can_float.rs b/src/test/ui/simd/libm_std_can_float.rs index 6a844e7120e..1c520856e98 100644 --- a/src/test/ui/simd/libm_std_can_float.rs +++ b/src/test/ui/simd/libm_std_can_float.rs @@ -3,7 +3,7 @@ // This is the converse of the other libm test. #![feature(portable_simd)] use std::simd::f32x4; -use std::simd::StdFloat; +use std::simd::{SimdFloat, StdFloat}; // For SIMD float ops, the LLIR version which is used to implement the portable // forms of them may become calls to math.h AKA libm. So, we can't guarantee