Skip to content

Commit f8aa494

Browse files
Introduce core::simd trait imports in tests
1 parent a14404a commit f8aa494

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

library/core/src/slice/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3569,6 +3569,7 @@ impl<T> [T] {
35693569
///
35703570
/// ```
35713571
/// #![feature(portable_simd)]
3572+
/// use core::simd::SimdFloat;
35723573
///
35733574
/// let short = &[1, 2, 3];
35743575
/// let (prefix, middle, suffix) = short.as_simd::<4>();

library/core/tests/simd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use core::simd::f32x4;
2+
use core::simd::SimdFloat;
23

34
#[test]
45
fn testing() {

src/test/codegen/simd-wide-sum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![crate_type = "lib"]
66
#![feature(portable_simd)]
77

8-
use std::simd::Simd;
8+
use std::simd::{Simd, SimdUint};
99
const N: usize = 8;
1010

1111
#[no_mangle]

src/test/ui/simd/libm_no_std_cant_float.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![no_std]
33
#![feature(portable_simd)]
44
use core::simd::f32x4;
5+
use core::simd::SimdFloat;
56

67
// For SIMD float ops, the LLIR version which is used to implement the portable
78
// forms of them may become calls to math.h AKA libm. So, we can't guarantee

src/test/ui/simd/libm_no_std_cant_float.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
error[E0599]: no method named `ceil` found for struct `Simd` in the current scope
2-
--> $DIR/libm_no_std_cant_float.rs:14:17
2+
--> $DIR/libm_no_std_cant_float.rs:15:17
33
|
44
LL | let _xc = x.ceil();
55
| ^^^^ method not found in `Simd<f32, 4_usize>`
66

77
error[E0599]: no method named `floor` found for struct `Simd` in the current scope
8-
--> $DIR/libm_no_std_cant_float.rs:15:17
8+
--> $DIR/libm_no_std_cant_float.rs:16:17
99
|
1010
LL | let _xf = x.floor();
1111
| ^^^^^ method not found in `Simd<f32, 4_usize>`
1212

1313
error[E0599]: no method named `round` found for struct `Simd` in the current scope
14-
--> $DIR/libm_no_std_cant_float.rs:16:17
14+
--> $DIR/libm_no_std_cant_float.rs:17:17
1515
|
1616
LL | let _xr = x.round();
1717
| ^^^^^ method not found in `Simd<f32, 4_usize>`
1818

1919
error[E0599]: no method named `trunc` found for struct `Simd` in the current scope
20-
--> $DIR/libm_no_std_cant_float.rs:17:17
20+
--> $DIR/libm_no_std_cant_float.rs:18:17
2121
|
2222
LL | let _xt = x.trunc();
2323
| ^^^^^ method not found in `Simd<f32, 4_usize>`
2424

2525
error[E0599]: no method named `mul_add` found for struct `Simd` in the current scope
26-
--> $DIR/libm_no_std_cant_float.rs:18:19
26+
--> $DIR/libm_no_std_cant_float.rs:19:19
2727
|
2828
LL | let _xfma = x.mul_add(x, x);
2929
| ^^^^^^^ method not found in `Simd<f32, 4_usize>`
3030

3131
error[E0599]: no method named `sqrt` found for struct `Simd` in the current scope
32-
--> $DIR/libm_no_std_cant_float.rs:19:20
32+
--> $DIR/libm_no_std_cant_float.rs:20:20
3333
|
3434
LL | let _xsqrt = x.sqrt();
3535
| ^^^^ method not found in `Simd<f32, 4_usize>`

src/test/ui/simd/libm_std_can_float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// This is the converse of the other libm test.
44
#![feature(portable_simd)]
55
use std::simd::f32x4;
6-
use std::simd::StdFloat;
6+
use std::simd::{SimdFloat, StdFloat};
77

88
// For SIMD float ops, the LLIR version which is used to implement the portable
99
// forms of them may become calls to math.h AKA libm. So, we can't guarantee

0 commit comments

Comments
 (0)