]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/borrowck/borrowck-multiple-captures.nll.stderr
New upstream version 1.34.2+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-multiple-captures.nll.stderr
index 6f4cad2a01e48201a80c26966320b5f15feac58d..d0065a2e7dc3d817ee80f60761804a3b0403a91f 100644 (file)
@@ -29,6 +29,8 @@ LL |     borrow(&*p2);
 error[E0382]: use of moved value: `x1`
   --> $DIR/borrowck-multiple-captures.rs:25:19
    |
+LL |     let x1: Box<_> = box 1;
+   |         -- move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
 LL |     drop(x1);
    |          -- value moved here
 ...
@@ -36,12 +38,12 @@ LL |     thread::spawn(move|| {
    |                   ^^^^^^ value used here after move
 LL |         drop(x1); //~ ERROR capture of moved value: `x1`
    |              -- use occurs due to use in closure
-   |
-   = note: move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
 
 error[E0382]: use of moved value: `x2`
   --> $DIR/borrowck-multiple-captures.rs:25:19
    |
+LL |     let x2: Box<_> = box 2;
+   |         -- move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
 LL |     drop(x2);
    |          -- value moved here
 LL |     thread::spawn(move|| {
@@ -49,8 +51,6 @@ LL |     thread::spawn(move|| {
 LL |         drop(x1); //~ ERROR capture of moved value: `x1`
 LL |         drop(x2); //~ ERROR capture of moved value: `x2`
    |              -- use occurs due to use in closure
-   |
-   = note: move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
 
 error[E0382]: use of moved value: `x`
   --> $DIR/borrowck-multiple-captures.rs:36:14
@@ -88,14 +88,14 @@ LL |         drop(x); //~ ERROR use of moved value: `x`
 error[E0382]: use of moved value: `x`
   --> $DIR/borrowck-multiple-captures.rs:44:19
    |
+LL |     let x: Box<_> = box 1;
+   |         - move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
 LL |     drop(x);
    |          - value moved here
 LL |     thread::spawn(move|| {
    |                   ^^^^^^ value used here after move
 LL |         drop(x); //~ ERROR capture of moved value: `x`
    |              - use occurs due to use in closure
-   |
-   = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
 
 error: aborting due to 8 previous errors