File tree Expand file tree Collapse file tree 3 files changed +8
-33
lines changed Expand file tree Collapse file tree 3 files changed +8
-33
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,7 @@ extern "platform-intrinsic" {
3333pub fn main ( ) {
3434 let mut t = T :: < i32x4 > ( [ 0 ; 4 ] ) ;
3535 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 ) ) ;
4338 }
4439}
Original file line number Diff line number Diff line change @@ -23,18 +23,6 @@ LL | pub struct T<S: Simd>([S::Lane; S::SIZE]);
2323 = help: try adding a `where` bound using this expression: `where [(); S::SIZE]:`
2424 = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
2525
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
3827
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() {
2222 let mut s = S ( [ 0 ; 4 ] ) ;
2323
2424 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 ) ) ;
3127 }
3228
3329 let mut t = T :: < 4 > ( [ 0 ; 4 ] ) ;
3430 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 ) ) ;
4133 }
4234}
You can’t perform that action at this time.
0 commit comments