Converted moves-based-on-type-tuple test and added MIR borrowck comparison.
This commit is contained in:
parent
81622c6b02
commit
c428b7d9c1
@ -10,9 +10,14 @@
|
||||
|
||||
#![feature(box_syntax)]
|
||||
|
||||
// compile-flags: -Z emit-end-regions -Z borrowck=compare
|
||||
|
||||
fn dup(x: Box<isize>) -> Box<(Box<isize>,Box<isize>)> {
|
||||
box (x, x) //~ ERROR use of moved value
|
||||
box (x, x)
|
||||
//~^ use of moved value: `x` (Ast) [E0382]
|
||||
//~| use of moved value: `x` (Mir) [E0382]
|
||||
}
|
||||
|
||||
fn main() {
|
||||
dup(box 3);
|
||||
}
|
22
src/test/ui/moves-based-on-type-tuple.stderr
Normal file
22
src/test/ui/moves-based-on-type-tuple.stderr
Normal file
@ -0,0 +1,22 @@
|
||||
error[E0382]: use of moved value: `x` (Ast)
|
||||
--> $DIR/moves-based-on-type-tuple.rs:16:13
|
||||
|
|
||||
16 | box (x, x)
|
||||
| - ^ value used here after move
|
||||
| |
|
||||
| value moved here
|
||||
|
|
||||
= note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of moved value: `x` (Mir)
|
||||
--> $DIR/moves-based-on-type-tuple.rs:16:13
|
||||
|
|
||||
16 | box (x, x)
|
||||
| - ^ value used here after move
|
||||
| |
|
||||
| value moved here
|
||||
|
|
||||
= note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Reference in New Issue
Block a user