Skip to content

Commit c428b7d

Browse files
committed
Converted moves-based-on-type-tuple test and added MIR borrowck comparison.
1 parent 81622c6 commit c428b7d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/test/compile-fail/moves-based-on-type-tuple.rs renamed to src/test/ui/moves-based-on-type-tuple.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@
1010

1111
#![feature(box_syntax)]
1212

13+
// compile-flags: -Z emit-end-regions -Z borrowck=compare
14+
1315
fn dup(x: Box<isize>) -> Box<(Box<isize>,Box<isize>)> {
14-
box (x, x) //~ ERROR use of moved value
16+
box (x, x)
17+
//~^ use of moved value: `x` (Ast) [E0382]
18+
//~| use of moved value: `x` (Mir) [E0382]
1519
}
20+
1621
fn main() {
1722
dup(box 3);
1823
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error[E0382]: use of moved value: `x` (Ast)
2+
--> $DIR/moves-based-on-type-tuple.rs:16:13
3+
|
4+
16 | box (x, x)
5+
| - ^ value used here after move
6+
| |
7+
| value moved here
8+
|
9+
= note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
10+
11+
error[E0382]: use of moved value: `x` (Mir)
12+
--> $DIR/moves-based-on-type-tuple.rs:16:13
13+
|
14+
16 | box (x, x)
15+
| - ^ value used here after move
16+
| |
17+
| value moved here
18+
|
19+
= note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
20+
21+
error: aborting due to 2 previous errors
22+

0 commit comments

Comments
 (0)