File tree 3 files changed +8
-33
lines changed
3 files changed +8
-33
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,7 @@ extern "platform-intrinsic" {
33
33
pub fn main ( ) {
34
34
let mut t = T :: < i32x4 > ( [ 0 ; 4 ] ) ;
35
35
unsafe {
36
- for i in 0_i32 ..4 {
37
- t = simd_insert ( t, i as u32 , i) ;
38
- }
39
- for i in 0_i32 ..4 {
40
- assert_eq ! ( i, simd_extract( t, i as u32 ) ) ;
41
- //~^ ERROR: use of moved value: `t`
42
- }
36
+ t = simd_insert ( t, 3 , 3 ) ;
37
+ assert_eq ! ( 3 , simd_extract( t, 3 ) ) ;
43
38
}
44
39
}
Original file line number Diff line number Diff line change @@ -23,18 +23,6 @@ LL | pub struct T<S: Simd>([S::Lane; S::SIZE]);
23
23
= help: try adding a `where` bound using this expression: `where [(); S::SIZE]:`
24
24
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
25
25
26
- error[E0382]: use of moved value: `t`
27
- --> $DIR/array-trait.rs:40:40
28
- |
29
- LL | let mut t = T::<i32x4>([0; 4]);
30
- | ----- move occurs because `t` has type `T<i32x4>`, which does not implement the `Copy` trait
31
- ...
32
- LL | for i in 0_i32..4 {
33
- | ----------------- inside of this loop
34
- LL | assert_eq!(i, simd_extract(t, i as u32));
35
- | ^ value moved here, in previous iteration of loop
36
-
37
- error: aborting due to 4 previous errors
26
+ error: aborting due to 3 previous errors
38
27
39
- Some errors have detailed explanations: E0077, E0382.
40
- For more information about an error, try `rustc --explain E0077`.
28
+ For more information about this error, try `rustc --explain E0077`.
Original file line number Diff line number Diff line change @@ -22,21 +22,13 @@ pub fn main() {
22
22
let mut s = S ( [ 0 ; 4 ] ) ;
23
23
24
24
unsafe {
25
- for i in 0_i32 ..4 {
26
- s = simd_insert ( s, i as u32 , i) ;
27
- }
28
- for i in 0_i32 ..4 {
29
- assert_eq ! ( i, simd_extract( s, i as u32 ) ) ;
30
- }
25
+ s = simd_insert ( s, 3 , 3 ) ;
26
+ assert_eq ! ( 3 , simd_extract( s, 3 ) ) ;
31
27
}
32
28
33
29
let mut t = T :: < 4 > ( [ 0 ; 4 ] ) ;
34
30
unsafe {
35
- for i in 0_i32 ..4 {
36
- t = simd_insert ( t, i as u32 , i) ;
37
- }
38
- for i in 0_i32 ..4 {
39
- assert_eq ! ( i, simd_extract( t, i as u32 ) ) ;
40
- }
31
+ t = simd_insert ( t, 3 , 3 ) ;
32
+ assert_eq ! ( 3 , simd_extract( t, 3 ) ) ;
41
33
}
42
34
}
You can’t perform that action at this time.
0 commit comments