Skip to content

Commit 9ca2902

Browse files
committed
update test
1 parent 1bdd6ca commit 9ca2902

5 files changed

+15
-4
lines changed

src/test/ui/borrowck/borrowck-move-out-from-array.mir.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | let [_, _x] = a;
55
| -- value moved here
66
LL | let [.., _y] = a; //[ast]~ ERROR [E0382]
77
| ^^ value used here after move
8+
|
9+
= note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
810

911
error[E0382]: use of moved value: `a[..]`
1012
--> $DIR/borrowck-move-out-from-array.rs:27:10
@@ -13,6 +15,8 @@ LL | let [_x, _] = a;
1315
| -- value moved here
1416
LL | let [_y..] = a; //[ast]~ ERROR [E0382]
1517
| ^^ value used here after move
18+
|
19+
= note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
1620

1721
error: aborting due to 2 previous errors
1822

src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ LL | f(f(10));
1414
| - ^ value used here after move
1515
| |
1616
| value moved here
17+
|
18+
= note: move occurs because `*f` has type `F`, which does not implement the `Copy` trait
1719

1820
error[E0499]: cannot borrow `*f` as mutable more than once at a time
1921
--> $DIR/two-phase-nonrecv-autoref.rs:86:11
@@ -43,6 +45,8 @@ LL | f(f(10));
4345
| - ^ value used here after move
4446
| |
4547
| value moved here
48+
|
49+
= note: move occurs because `*f` has type `dyn std::ops::FnOnce(i32) -> i32`, which does not implement the `Copy` trait
4650

4751
error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
4852
--> $DIR/two-phase-nonrecv-autoref.rs:139:27

src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | _ if { (|| { let bar = b; *bar = false; })();
88
LL | false } => { },
99
LL | &mut true => { println!("You might think we should get here"); },
1010
| ^^^^ value used here after move
11+
|
12+
= note: move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait
1113

1214
error: aborting due to previous error
1315

src/test/ui/use/use-after-move-self.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//compile-flags: -Z borrowck=mir
1112
#![feature(box_syntax)]
1213

1314
struct S {
@@ -17,7 +18,7 @@ struct S {
1718
impl S {
1819
pub fn foo(self) -> isize {
1920
self.bar();
20-
return *self.x; //~ ERROR use of moved value: `*self.x`
21+
return *self.x; //~ ERROR use of moved value: `self`
2122
}
2223

2324
pub fn bar(self) {}

src/test/ui/use/use-after-move-self.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error[E0382]: use of moved value: `*self.x`
2-
--> $DIR/use-after-move-self.rs:20:16
1+
error[E0382]: use of moved value: `self`
2+
--> $DIR/use-after-move-self.rs:21:16
33
|
44
LL | self.bar();
55
| ---- value moved here
6-
LL | return *self.x; //~ ERROR use of moved value: `*self.x`
6+
LL | return *self.x; //~ ERROR use of moved value: `self`
77
| ^^^^^^^ value used here after move
88
|
99
= note: move occurs because `self` has type `S`, which does not implement the `Copy` trait

0 commit comments

Comments
 (0)