diff --git a/src/test/compile-fail/moves-based-on-type-tuple.rs b/src/test/ui/moves-based-on-type-tuple.rs similarity index 77% rename from src/test/compile-fail/moves-based-on-type-tuple.rs rename to src/test/ui/moves-based-on-type-tuple.rs index a4d3e3ee02f..27903fee117 100644 --- a/src/test/compile-fail/moves-based-on-type-tuple.rs +++ b/src/test/ui/moves-based-on-type-tuple.rs @@ -10,9 +10,14 @@ #![feature(box_syntax)] +// compile-flags: -Z emit-end-regions -Z borrowck=compare + fn dup(x: Box) -> Box<(Box,Box)> { - 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); } diff --git a/src/test/ui/moves-based-on-type-tuple.stderr b/src/test/ui/moves-based-on-type-tuple.stderr new file mode 100644 index 00000000000..e1667107c92 --- /dev/null +++ b/src/test/ui/moves-based-on-type-tuple.stderr @@ -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`, 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`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors +