diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2019-04-22 08:40:08 +0100 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2019-04-22 08:40:08 +0100 |
| commit | 8eef102270647af94f38274efb9a2fd5ef8a92ec (patch) | |
| tree | 95d7674ad687c45b730906915e79a0993138306b /src/test/ui/moves | |
| parent | aa6fb6caf9d8456c70144ccba1e969c85926e229 (diff) | |
| download | rust-8eef102270647af94f38274efb9a2fd5ef8a92ec.tar.gz rust-8eef102270647af94f38274efb9a2fd5ef8a92ec.zip | |
update tests for migrate mode by default
Diffstat (limited to 'src/test/ui/moves')
42 files changed, 170 insertions, 519 deletions
diff --git a/src/test/ui/moves/move-guard-same-consts.nll.stderr b/src/test/ui/moves/move-guard-same-consts.nll.stderr deleted file mode 100644 index 0945fbe68a0..00000000000 --- a/src/test/ui/moves/move-guard-same-consts.nll.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0382]: use of moved value: `x` - --> $DIR/move-guard-same-consts.rs:20:24 - | -LL | let x: Box<_> = box 1; - | - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait -... -LL | (1, 2) if take(x) => (), - | - value moved here -LL | (1, 2) if take(x) => (), - | ^ value used here after move - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/move-guard-same-consts.stderr b/src/test/ui/moves/move-guard-same-consts.stderr index 65f6f1239fe..0945fbe68a0 100644 --- a/src/test/ui/moves/move-guard-same-consts.stderr +++ b/src/test/ui/moves/move-guard-same-consts.stderr @@ -1,12 +1,13 @@ error[E0382]: use of moved value: `x` --> $DIR/move-guard-same-consts.rs:20:24 | +LL | let x: Box<_> = box 1; + | - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait +... LL | (1, 2) if take(x) => (), | - value moved here LL | (1, 2) if take(x) => (), | ^ value used here after move - | - = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait error: aborting due to previous error diff --git a/src/test/ui/moves/move-in-guard-1.nll.stderr b/src/test/ui/moves/move-in-guard-1.nll.stderr deleted file mode 100644 index 542fd169863..00000000000 --- a/src/test/ui/moves/move-in-guard-1.nll.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0382]: use of moved value: `x` - --> $DIR/move-in-guard-1.rs:10:24 - | -LL | let x: Box<_> = box 1; - | - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait -... -LL | (1, _) if take(x) => (), - | - value moved here -LL | (_, 2) if take(x) => (), - | ^ value used here after move - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/move-in-guard-1.stderr b/src/test/ui/moves/move-in-guard-1.stderr index af49fa82b0f..542fd169863 100644 --- a/src/test/ui/moves/move-in-guard-1.stderr +++ b/src/test/ui/moves/move-in-guard-1.stderr @@ -1,12 +1,13 @@ error[E0382]: use of moved value: `x` --> $DIR/move-in-guard-1.rs:10:24 | +LL | let x: Box<_> = box 1; + | - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait +... LL | (1, _) if take(x) => (), | - value moved here LL | (_, 2) if take(x) => (), | ^ value used here after move - | - = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait error: aborting due to previous error diff --git a/src/test/ui/moves/move-in-guard-2.nll.stderr b/src/test/ui/moves/move-in-guard-2.nll.stderr deleted file mode 100644 index 8bd405279c5..00000000000 --- a/src/test/ui/moves/move-in-guard-2.nll.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0382]: use of moved value: `x` - --> $DIR/move-in-guard-2.rs:10:24 - | -LL | let x: Box<_> = box 1; - | - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait -... -LL | (_, 2) if take(x) => (), - | ^ value moved here, in previous iteration of loop - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/move-in-guard-2.stderr b/src/test/ui/moves/move-in-guard-2.stderr index 5228abe86ef..8bd405279c5 100644 --- a/src/test/ui/moves/move-in-guard-2.stderr +++ b/src/test/ui/moves/move-in-guard-2.stderr @@ -1,10 +1,11 @@ error[E0382]: use of moved value: `x` --> $DIR/move-in-guard-2.rs:10:24 | +LL | let x: Box<_> = box 1; + | - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait +... LL | (_, 2) if take(x) => (), - | ^ value moved here in previous iteration of loop - | - = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + | ^ value moved here, in previous iteration of loop error: aborting due to previous error diff --git a/src/test/ui/moves/move-into-dead-array-1.nll.stderr b/src/test/ui/moves/move-into-dead-array-1.nll.stderr deleted file mode 100644 index 33da0e54a1e..00000000000 --- a/src/test/ui/moves/move-into-dead-array-1.nll.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0381]: use of possibly uninitialized variable: `a` - --> $DIR/move-into-dead-array-1.rs:14:5 - | -LL | a[i] = d(); - | ^^^^ use of possibly uninitialized `a` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/moves/move-into-dead-array-1.stderr b/src/test/ui/moves/move-into-dead-array-1.stderr index 3a1bbe97d28..33da0e54a1e 100644 --- a/src/test/ui/moves/move-into-dead-array-1.stderr +++ b/src/test/ui/moves/move-into-dead-array-1.stderr @@ -2,7 +2,7 @@ error[E0381]: use of possibly uninitialized variable: `a` --> $DIR/move-into-dead-array-1.rs:14:5 | LL | a[i] = d(); - | ^^^^^^^^^^ use of possibly uninitialized `a` + | ^^^^ use of possibly uninitialized `a` error: aborting due to previous error diff --git a/src/test/ui/moves/move-into-dead-array-2.nll.stderr b/src/test/ui/moves/move-into-dead-array-2.nll.stderr deleted file mode 100644 index 19e476c04ea..00000000000 --- a/src/test/ui/moves/move-into-dead-array-2.nll.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0382]: use of moved value: `a` - --> $DIR/move-into-dead-array-2.rs:14:5 - | -LL | fn foo(mut a: [D; 4], i: usize) { - | ----- move occurs because `a` has type `[D; 4]`, which does not implement the `Copy` trait -LL | drop(a); - | - value moved here -LL | a[i] = d(); - | ^^^^ value used here after move - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/move-into-dead-array-2.stderr b/src/test/ui/moves/move-into-dead-array-2.stderr index 4521fa9bcb0..19e476c04ea 100644 --- a/src/test/ui/moves/move-into-dead-array-2.stderr +++ b/src/test/ui/moves/move-into-dead-array-2.stderr @@ -1,12 +1,12 @@ error[E0382]: use of moved value: `a` --> $DIR/move-into-dead-array-2.rs:14:5 | +LL | fn foo(mut a: [D; 4], i: usize) { + | ----- move occurs because `a` has type `[D; 4]`, which does not implement the `Copy` trait LL | drop(a); | - value moved here LL | a[i] = d(); - | ^^^^^^^^^^ value used here after move - | - = note: move occurs because `a` has type `[D; 4]`, which does not implement the `Copy` trait + | ^^^^ value used here after move error: aborting due to previous error diff --git a/src/test/ui/moves/move-out-of-slice-1.nll.stderr b/src/test/ui/moves/move-out-of-slice-1.nll.stderr deleted file mode 100644 index b4b1fe97ca9..00000000000 --- a/src/test/ui/moves/move-out-of-slice-1.nll.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0508]: cannot move out of type `[A]`, a non-copy slice - --> $DIR/move-out-of-slice-1.rs:7:11 - | -LL | match a { - | ^ cannot move out of here -LL | box [a] => {}, - | - data moved here - | -note: move occurs because `a` has type `A`, which does not implement the `Copy` trait - --> $DIR/move-out-of-slice-1.rs:8:14 - | -LL | box [a] => {}, - | ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/moves/move-out-of-slice-1.rs b/src/test/ui/moves/move-out-of-slice-1.rs index 3e0906060e6..982648f5b23 100644 --- a/src/test/ui/moves/move-out-of-slice-1.rs +++ b/src/test/ui/moves/move-out-of-slice-1.rs @@ -4,8 +4,8 @@ struct A; fn main() { let a: Box<[A]> = Box::new([A]); - match a { - box [a] => {}, //~ ERROR cannot move out of type `[A]`, a non-copy slice + match a { //~ ERROR cannot move out of type `[A]`, a non-copy slice + box [a] => {}, _ => {} } } diff --git a/src/test/ui/moves/move-out-of-slice-1.stderr b/src/test/ui/moves/move-out-of-slice-1.stderr index f84e3a3f3e3..b4b1fe97ca9 100644 --- a/src/test/ui/moves/move-out-of-slice-1.stderr +++ b/src/test/ui/moves/move-out-of-slice-1.stderr @@ -1,11 +1,16 @@ error[E0508]: cannot move out of type `[A]`, a non-copy slice - --> $DIR/move-out-of-slice-1.rs:8:13 + --> $DIR/move-out-of-slice-1.rs:7:11 | +LL | match a { + | ^ cannot move out of here LL | box [a] => {}, - | ^-^ - | || - | |hint: to prevent move, use `ref a` or `ref mut a` - | cannot move out of here + | - data moved here + | +note: move occurs because `a` has type `A`, which does not implement the `Copy` trait + --> $DIR/move-out-of-slice-1.rs:8:14 + | +LL | box [a] => {}, + | ^ error: aborting due to previous error diff --git a/src/test/ui/moves/move-out-of-tuple-field.nll.stderr b/src/test/ui/moves/move-out-of-tuple-field.nll.stderr deleted file mode 100644 index 888ef3352e2..00000000000 --- a/src/test/ui/moves/move-out-of-tuple-field.nll.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0382]: use of moved value: `x.0` - --> $DIR/move-out-of-tuple-field.rs:8:13 - | -LL | let y = x.0; - | --- value moved here -LL | let z = x.0; - | ^^^ value used here after move - | - = note: move occurs because `x.0` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait - -error[E0382]: use of moved value: `x.0` - --> $DIR/move-out-of-tuple-field.rs:12:13 - | -LL | let y = x.0; - | --- value moved here -LL | let z = x.0; - | ^^^ value used here after move - | - = note: move occurs because `x.0` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/move-out-of-tuple-field.stderr b/src/test/ui/moves/move-out-of-tuple-field.stderr index 89662c8303d..888ef3352e2 100644 --- a/src/test/ui/moves/move-out-of-tuple-field.stderr +++ b/src/test/ui/moves/move-out-of-tuple-field.stderr @@ -1,20 +1,20 @@ error[E0382]: use of moved value: `x.0` - --> $DIR/move-out-of-tuple-field.rs:8:9 + --> $DIR/move-out-of-tuple-field.rs:8:13 | LL | let y = x.0; - | - value moved here + | --- value moved here LL | let z = x.0; - | ^ value used here after move + | ^^^ value used here after move | = note: move occurs because `x.0` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait error[E0382]: use of moved value: `x.0` - --> $DIR/move-out-of-tuple-field.rs:12:9 + --> $DIR/move-out-of-tuple-field.rs:12:13 | LL | let y = x.0; - | - value moved here + | --- value moved here LL | let z = x.0; - | ^ value used here after move + | ^^^ value used here after move | = note: move occurs because `x.0` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait diff --git a/src/test/ui/moves/moves-based-on-type-access-to-field.nll.stderr b/src/test/ui/moves/moves-based-on-type-access-to-field.nll.stderr deleted file mode 100644 index 71a3c4506ea..00000000000 --- a/src/test/ui/moves/moves-based-on-type-access-to-field.nll.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-access-to-field.rs:11:12 - | -LL | let x = vec!["hi".to_string()]; - | - move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait -LL | consume(x.into_iter().next().unwrap()); - | - value moved here -LL | touch(&x[0]); - | ^ value borrowed here after move - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-based-on-type-access-to-field.rs b/src/test/ui/moves/moves-based-on-type-access-to-field.rs index c7ea357a5d9..e2003ed6e47 100644 --- a/src/test/ui/moves/moves-based-on-type-access-to-field.rs +++ b/src/test/ui/moves/moves-based-on-type-access-to-field.rs @@ -8,7 +8,7 @@ fn touch<A>(_a: &A) {} fn f20() { let x = vec!["hi".to_string()]; consume(x.into_iter().next().unwrap()); - touch(&x[0]); //~ ERROR use of moved value: `x` + touch(&x[0]); //~ ERROR borrow of moved value: `x` } fn main() {} diff --git a/src/test/ui/moves/moves-based-on-type-access-to-field.stderr b/src/test/ui/moves/moves-based-on-type-access-to-field.stderr index ed4d69f838e..71a3c4506ea 100644 --- a/src/test/ui/moves/moves-based-on-type-access-to-field.stderr +++ b/src/test/ui/moves/moves-based-on-type-access-to-field.stderr @@ -1,12 +1,12 @@ -error[E0382]: use of moved value: `x` +error[E0382]: borrow of moved value: `x` --> $DIR/moves-based-on-type-access-to-field.rs:11:12 | +LL | let x = vec!["hi".to_string()]; + | - move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait LL | consume(x.into_iter().next().unwrap()); | - value moved here LL | touch(&x[0]); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + | ^ value borrowed here after move error: aborting due to previous error diff --git a/src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr b/src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr deleted file mode 100644 index b83a15c9d4d..00000000000 --- a/src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0507]: cannot move out of borrowed content - --> $DIR/moves-based-on-type-block-bad.rs:24:19 - | -LL | match hellothere.x { - | ^^^^^^^^^^^^ - | | - | cannot move out of borrowed content - | help: consider borrowing here: `&hellothere.x` -... -LL | box E::Bar(x) => println!("{}", x.to_string()), - | - data moved here - | -note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait - --> $DIR/moves-based-on-type-block-bad.rs:27:28 - | -LL | box E::Bar(x) => println!("{}", x.to_string()), - | ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/moves/moves-based-on-type-block-bad.stderr b/src/test/ui/moves/moves-based-on-type-block-bad.stderr index f5328edfcc2..b83a15c9d4d 100644 --- a/src/test/ui/moves/moves-based-on-type-block-bad.stderr +++ b/src/test/ui/moves/moves-based-on-type-block-bad.stderr @@ -2,10 +2,19 @@ error[E0507]: cannot move out of borrowed content --> $DIR/moves-based-on-type-block-bad.rs:24:19 | LL | match hellothere.x { - | ^^^^^^^^^^ cannot move out of borrowed content + | ^^^^^^^^^^^^ + | | + | cannot move out of borrowed content + | help: consider borrowing here: `&hellothere.x` ... LL | box E::Bar(x) => println!("{}", x.to_string()), - | - hint: to prevent move, use `ref x` or `ref mut x` + | - data moved here + | +note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + --> $DIR/moves-based-on-type-block-bad.rs:27:28 + | +LL | box E::Bar(x) => println!("{}", x.to_string()), + | ^ error: aborting due to previous error diff --git a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.nll.stderr b/src/test/ui/moves/moves-based-on-type-capture-clause-bad.nll.stderr deleted file mode 100644 index 3a05a1305be..00000000000 --- a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.nll.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-capture-clause-bad.rs:8:20 - | -LL | let x = "Hello world!".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -LL | thread::spawn(move|| { - | ------ value moved into closure here -LL | println!("{}", x); - | - variable moved due to use in closure -LL | }); -LL | println!("{}", x); - | ^ value borrowed here after move - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.rs b/src/test/ui/moves/moves-based-on-type-capture-clause-bad.rs index d5f44a0b3f7..b2f68352f89 100644 --- a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.rs +++ b/src/test/ui/moves/moves-based-on-type-capture-clause-bad.rs @@ -5,5 +5,5 @@ fn main() { thread::spawn(move|| { println!("{}", x); }); - println!("{}", x); //~ ERROR use of moved value + println!("{}", x); //~ ERROR borrow of moved value } diff --git a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.stderr b/src/test/ui/moves/moves-based-on-type-capture-clause-bad.stderr index 39119ff3aaa..3a05a1305be 100644 --- a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.stderr +++ b/src/test/ui/moves/moves-based-on-type-capture-clause-bad.stderr @@ -1,13 +1,15 @@ -error[E0382]: use of moved value: `x` +error[E0382]: borrow of moved value: `x` --> $DIR/moves-based-on-type-capture-clause-bad.rs:8:20 | +LL | let x = "Hello world!".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait LL | thread::spawn(move|| { - | ------ value moved (into closure) here -... + | ------ value moved into closure here +LL | println!("{}", x); + | - variable moved due to use in closure +LL | }); LL | println!("{}", x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^ value borrowed here after move error: aborting due to previous error diff --git a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.nll.stderr b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.nll.stderr deleted file mode 100644 index fb8562d00ea..00000000000 --- a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.nll.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0382]: use of moved value: `node` - --> $DIR/moves-based-on-type-cyclic-types-issue-4821.rs:13:13 - | -LL | Some(right) => consume(right), - | ----- value moved here -... -LL | consume(node) + r - | ^^^^ value used here after partial move - | - = note: move occurs because value has type `std::boxed::Box<List>`, which does not implement the `Copy` trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.rs b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.rs index 4417fb926d9..b070671cb25 100644 --- a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.rs +++ b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.rs @@ -10,7 +10,7 @@ fn foo(node: Box<List>) -> isize { Some(right) => consume(right), None => 0 }; - consume(node) + r //~ ERROR use of partially moved value: `node` + consume(node) + r //~ ERROR use of moved value: `node` } fn consume(v: Box<List>) -> isize { diff --git a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr index 8b904c7169b..fb8562d00ea 100644 --- a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr +++ b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr @@ -1,13 +1,13 @@ -error[E0382]: use of partially moved value: `node` +error[E0382]: use of moved value: `node` --> $DIR/moves-based-on-type-cyclic-types-issue-4821.rs:13:13 | LL | Some(right) => consume(right), | ----- value moved here ... LL | consume(node) + r - | ^^^^ value used here after move + | ^^^^ value used here after partial move | - = note: move occurs because the value has type `std::boxed::Box<List>`, which does not implement the `Copy` trait + = note: move occurs because value has type `std::boxed::Box<List>`, which does not implement the `Copy` trait error: aborting due to previous error diff --git a/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.nll.stderr b/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.nll.stderr deleted file mode 100644 index 25f88fe157a..00000000000 --- a/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.nll.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:11:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -LL | let _y = Foo { f:x }; - | - value moved here -LL | -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:20:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -LL | let _y = Foo { f:(((x))) }; - | ------- value moved here -LL | -LL | touch(&x); - | ^^ value borrowed here after move - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.rs b/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.rs index 7c7ca0044e2..0b44ca56ced 100644 --- a/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.rs +++ b/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.rs @@ -6,20 +6,20 @@ fn touch<A>(_a: &A) {} fn f00() { let x = "hi".to_string(); + //~^ NOTE move occurs because `x` has type `std::string::String` let _y = Foo { f:x }; //~^ NOTE value moved here - touch(&x); //~ ERROR use of moved value: `x` - //~^ NOTE value used here after move - //~| NOTE move occurs because `x` has type `std::string::String` + touch(&x); //~ ERROR borrow of moved value: `x` + //~^ NOTE value borrowed here after move } fn f05() { let x = "hi".to_string(); + //~^ NOTE move occurs because `x` has type `std::string::String` let _y = Foo { f:(((x))) }; //~^ NOTE value moved here - touch(&x); //~ ERROR use of moved value: `x` - //~^ NOTE value used here after move - //~| NOTE move occurs because `x` has type `std::string::String` + touch(&x); //~ ERROR borrow of moved value: `x` + //~^ NOTE value borrowed here after move } fn f10() { diff --git a/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.stderr b/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.stderr index edf521a896f..d7a7ceabf85 100644 --- a/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.stderr +++ b/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.stderr @@ -1,24 +1,26 @@ -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:11:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:12:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait +LL | LL | let _y = Foo { f:x }; | - value moved here LL | LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:20:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:21:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait +LL | LL | let _y = Foo { f:(((x))) }; | ------- value moved here LL | LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move error: aborting due to 2 previous errors diff --git a/src/test/ui/moves/moves-based-on-type-exprs.nll.stderr b/src/test/ui/moves/moves-based-on-type-exprs.nll.stderr deleted file mode 100644 index 67fae606c4e..00000000000 --- a/src/test/ui/moves/moves-based-on-type-exprs.nll.stderr +++ /dev/null @@ -1,123 +0,0 @@ -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:12:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -LL | let _y = Foo { f:x }; - | - value moved here -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:18:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -LL | let _y = (x, 3); - | - value moved here -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:35:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -... -LL | x - | - value moved here -... -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `y` - --> $DIR/moves-based-on-type-exprs.rs:36:11 - | -LL | let y = "ho".to_string(); - | - move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait -... -LL | y - | - value moved here -... -LL | touch(&y); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:46:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -... -LL | true => x, - | - value moved here -... -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `y` - --> $DIR/moves-based-on-type-exprs.rs:47:11 - | -LL | let y = "ho".to_string(); - | - move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait -... -LL | false => y - | - value moved here -... -LL | touch(&y); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:58:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -... -LL | _ if guard(x) => 10, - | - value moved here -... -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:65:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -LL | let _y = [x]; - | - value moved here -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:71:11 - | -LL | let x = "hi".to_string(); - | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait -LL | let _y = vec![x]; - | - value moved here -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:77:11 - | -LL | let x = vec!["hi".to_string()]; - | - move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait -LL | let _y = x.into_iter().next().unwrap(); - | - value moved here -LL | touch(&x); - | ^^ value borrowed here after move - -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:83:11 - | -LL | let x = vec!["hi".to_string()]; - | - move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait -LL | let _y = [x.into_iter().next().unwrap(); 1]; - | - value moved here -LL | touch(&x); - | ^^ value borrowed here after move - -error: aborting due to 11 previous errors - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-based-on-type-exprs.rs b/src/test/ui/moves/moves-based-on-type-exprs.rs index b058f83291b..4a52d8d3206 100644 --- a/src/test/ui/moves/moves-based-on-type-exprs.rs +++ b/src/test/ui/moves/moves-based-on-type-exprs.rs @@ -9,13 +9,13 @@ fn touch<A>(_a: &A) {} fn f10() { let x = "hi".to_string(); let _y = Foo { f:x }; - touch(&x); //~ ERROR use of moved value: `x` + touch(&x); //~ ERROR borrow of moved value: `x` } fn f20() { let x = "hi".to_string(); let _y = (x, 3); - touch(&x); //~ ERROR use of moved value: `x` + touch(&x); //~ ERROR borrow of moved value: `x` } fn f21() { @@ -32,8 +32,8 @@ fn f30(cond: bool) { } else { y }; - touch(&x); //~ ERROR use of moved value: `x` - touch(&y); //~ ERROR use of moved value: `y` + touch(&x); //~ ERROR borrow of moved value: `x` + touch(&y); //~ ERROR borrow of moved value: `y` } fn f40(cond: bool) { @@ -43,8 +43,8 @@ fn f40(cond: bool) { true => x, false => y }; - touch(&x); //~ ERROR use of moved value: `x` - touch(&y); //~ ERROR use of moved value: `y` + touch(&x); //~ ERROR borrow of moved value: `x` + touch(&y); //~ ERROR borrow of moved value: `y` } fn f50(cond: bool) { @@ -55,32 +55,32 @@ fn f50(cond: bool) { true => 10, false => 20, }; - touch(&x); //~ ERROR use of moved value: `x` + touch(&x); //~ ERROR borrow of moved value: `x` touch(&y); } fn f70() { let x = "hi".to_string(); let _y = [x]; - touch(&x); //~ ERROR use of moved value: `x` + touch(&x); //~ ERROR borrow of moved value: `x` } fn f80() { let x = "hi".to_string(); let _y = vec![x]; - touch(&x); //~ ERROR use of moved value: `x` + touch(&x); //~ ERROR borrow of moved value: `x` } fn f100() { let x = vec!["hi".to_string()]; let _y = x.into_iter().next().unwrap(); - touch(&x); //~ ERROR use of moved value: `x` + touch(&x); //~ ERROR borrow of moved value: `x` } fn f110() { let x = vec!["hi".to_string()]; let _y = [x.into_iter().next().unwrap(); 1]; - touch(&x); //~ ERROR use of moved value: `x` + touch(&x); //~ ERROR borrow of moved value: `x` } fn f120() { diff --git a/src/test/ui/moves/moves-based-on-type-exprs.stderr b/src/test/ui/moves/moves-based-on-type-exprs.stderr index 6cb297cbd63..67fae606c4e 100644 --- a/src/test/ui/moves/moves-based-on-type-exprs.stderr +++ b/src/test/ui/moves/moves-based-on-type-exprs.stderr @@ -1,117 +1,122 @@ -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:12:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:12:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait LL | let _y = Foo { f:x }; | - value moved here LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:18:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:18:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait LL | let _y = (x, 3); | - value moved here LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:35:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:35:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait +... LL | x | - value moved here ... LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `y` - --> $DIR/moves-based-on-type-exprs.rs:36:12 +error[E0382]: borrow of moved value: `y` + --> $DIR/moves-based-on-type-exprs.rs:36:11 | +LL | let y = "ho".to_string(); + | - move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait +... LL | y | - value moved here ... LL | touch(&y); - | ^ value used here after move - | - = note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:46:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:46:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait +... LL | true => x, | - value moved here ... LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `y` - --> $DIR/moves-based-on-type-exprs.rs:47:12 +error[E0382]: borrow of moved value: `y` + --> $DIR/moves-based-on-type-exprs.rs:47:11 | +LL | let y = "ho".to_string(); + | - move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait +... LL | false => y | - value moved here ... LL | touch(&y); - | ^ value used here after move - | - = note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:58:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:58:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait +... LL | _ if guard(x) => 10, | - value moved here ... LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:65:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:65:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait LL | let _y = [x]; | - value moved here LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:71:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:71:11 | +LL | let x = "hi".to_string(); + | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait LL | let _y = vec![x]; | - value moved here LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:77:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:77:11 | +LL | let x = vec!["hi".to_string()]; + | - move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait LL | let _y = x.into_iter().next().unwrap(); | - value moved here LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + | ^^ value borrowed here after move -error[E0382]: use of moved value: `x` - --> $DIR/moves-based-on-type-exprs.rs:83:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:83:11 | +LL | let x = vec!["hi".to_string()]; + | - move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait LL | let _y = [x.into_iter().next().unwrap(); 1]; | - value moved here LL | touch(&x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + | ^^ value borrowed here after move error: aborting due to 11 previous errors diff --git a/src/test/ui/moves/moves-based-on-type-match-bindings.nll.stderr b/src/test/ui/moves/moves-based-on-type-match-bindings.nll.stderr deleted file mode 100644 index 322999a1f0f..00000000000 --- a/src/test/ui/moves/moves-based-on-type-match-bindings.nll.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0382]: borrow of moved value: `x` - --> $DIR/moves-based-on-type-match-bindings.rs:16:11 - | -LL | Foo {f} => {} - | - value moved here -... -LL | touch(&x); - | ^^ value borrowed here after partial move - | - = note: move occurs because `x.f` has type `std::string::String`, which does not implement the `Copy` trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-based-on-type-match-bindings.rs b/src/test/ui/moves/moves-based-on-type-match-bindings.rs index 59e5a8f684e..1290d4a25ab 100644 --- a/src/test/ui/moves/moves-based-on-type-match-bindings.rs +++ b/src/test/ui/moves/moves-based-on-type-match-bindings.rs @@ -13,8 +13,8 @@ fn f10() { Foo {f} => {} }; - touch(&x); //~ ERROR use of partially moved value: `x` - //~^ value used here after move + touch(&x); //~ ERROR borrow of moved value: `x` + //~^ value borrowed here after partial move //~| move occurs because `x.f` has type `std::string::String` } diff --git a/src/test/ui/moves/moves-based-on-type-match-bindings.stderr b/src/test/ui/moves/moves-based-on-type-match-bindings.stderr index 9174cfa122c..322999a1f0f 100644 --- a/src/test/ui/moves/moves-based-on-type-match-bindings.stderr +++ b/src/test/ui/moves/moves-based-on-type-match-bindings.stderr @@ -1,11 +1,11 @@ -error[E0382]: use of partially moved value: `x` - --> $DIR/moves-based-on-type-match-bindings.rs:16:12 +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-match-bindings.rs:16:11 | LL | Foo {f} => {} | - value moved here ... LL | touch(&x); - | ^ value used here after move + | ^^ value borrowed here after partial move | = note: move occurs because `x.f` has type `std::string::String`, which does not implement the `Copy` trait diff --git a/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr b/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr deleted file mode 100644 index 0568a2e94a7..00000000000 --- a/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:11:28 - | -LL | let i = box 3; - | - captured outer variable -LL | let _f = to_fn(|| test(i)); - | ^ cannot move out of captured variable in an `Fn` closure - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr b/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr index 654881d25e6..0568a2e94a7 100644 --- a/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr +++ b/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr @@ -1,10 +1,10 @@ -error[E0507]: cannot move out of captured outer variable in an `Fn` closure +error[E0507]: cannot move out of captured variable in an `Fn` closure --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:11:28 | LL | let i = box 3; | - captured outer variable LL | let _f = to_fn(|| test(i)); - | ^ cannot move out of captured outer variable in an `Fn` closure + | ^ cannot move out of captured variable in an `Fn` closure error: aborting due to previous error diff --git a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.nll.stderr b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.nll.stderr deleted file mode 100644 index 483c364752b..00000000000 --- a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.nll.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0499]: cannot borrow `*f` as mutable more than once at a time - --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:20:27 - | -LL | (f.c)(f, true); - | ----- ^ second mutable borrow occurs here - | | - | first mutable borrow occurs here - | first borrow later used by call - -error[E0382]: borrow of moved value: `f` - --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:32:5 - | -LL | fn conspirator<F>(mut f: F) where F: FnMut(&mut R, bool) { - | - ----- move occurs because `f` has type `F`, which does not implement the `Copy` trait - | | - | consider adding a `Copy` constraint to this type argument -LL | let mut r = R {c: Box::new(f)}; - | - value moved here -LL | f(&mut r, false) - | ^ value borrowed here after move - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0382, E0499. -For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs index 737a131c9bf..3fa11878629 100644 --- a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs +++ b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs @@ -29,7 +29,7 @@ fn innocent_looking_victim() { fn conspirator<F>(mut f: F) where F: FnMut(&mut R, bool) { let mut r = R {c: Box::new(f)}; - f(&mut r, false) //~ ERROR use of moved value + f(&mut r, false) //~ ERROR borrow of moved value } fn main() { innocent_looking_victim() } diff --git a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr index bdc736576c9..483c364752b 100644 --- a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr +++ b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr @@ -2,20 +2,22 @@ error[E0499]: cannot borrow `*f` as mutable more than once at a time --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:20:27 | LL | (f.c)(f, true); - | ----- ^ - first borrow ends here - | | | - | | second mutable borrow occurs here + | ----- ^ second mutable borrow occurs here + | | | first mutable borrow occurs here + | first borrow later used by call -error[E0382]: use of moved value: `f` +error[E0382]: borrow of moved value: `f` --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:32:5 | +LL | fn conspirator<F>(mut f: F) where F: FnMut(&mut R, bool) { + | - ----- move occurs because `f` has type `F`, which does not implement the `Copy` trait + | | + | consider adding a `Copy` constraint to this type argument LL | let mut r = R {c: Box::new(f)}; | - value moved here LL | f(&mut r, false) - | ^ value used here after move - | - = note: move occurs because `f` has type `F`, which does not implement the `Copy` trait + | ^ value borrowed here after move error: aborting due to 2 previous errors diff --git a/src/test/ui/moves/moves-sru-moved-field.nll.stderr b/src/test/ui/moves/moves-sru-moved-field.nll.stderr deleted file mode 100644 index a012c2d9b7b..00000000000 --- a/src/test/ui/moves/moves-sru-moved-field.nll.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0382]: use of moved value: `f.moved` - --> $DIR/moves-sru-moved-field.rs:20:14 - | -LL | let _b = Foo {noncopyable: g, ..f}; - | ------------------------- value moved here -LL | let _c = Foo {noncopyable: h, ..f}; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ value used here after move - | - = note: move occurs because `f.moved` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/moves/moves-sru-moved-field.stderr b/src/test/ui/moves/moves-sru-moved-field.stderr index aac399ea4a1..a012c2d9b7b 100644 --- a/src/test/ui/moves/moves-sru-moved-field.stderr +++ b/src/test/ui/moves/moves-sru-moved-field.stderr @@ -1,10 +1,10 @@ error[E0382]: use of moved value: `f.moved` - --> $DIR/moves-sru-moved-field.rs:20:37 + --> $DIR/moves-sru-moved-field.rs:20:14 | LL | let _b = Foo {noncopyable: g, ..f}; - | - value moved here + | ------------------------- value moved here LL | let _c = Foo {noncopyable: h, ..f}; - | ^ value used here after move + | ^^^^^^^^^^^^^^^^^^^^^^^^^ value used here after move | = note: move occurs because `f.moved` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait |
