-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
e.g. in the test moves-based-on-type-tuple
:
#![feature(box_syntax)]
fn dup(x: Box<isize>) -> Box<(Box<isize>,Box<isize>)> {
box (x, x) //~ ERROR use of moved value
}
fn main() {
dup(box 3);
}
In the "use of moved value" error, AST borrowck reports the type of the moved value, while MIR borrowck doesn't:
error[E0382]: use of moved value: `x` (Ast)
--> /home/ariel/Rust/rust-master/src/test/compile-fail/moves-based-on-type-tuple.rs:14:13
|
14 | box (x, x) //~ ERROR use of moved value
| - ^ 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
COMMENT MINE: \----- it would be nice if MIR borrowck would report this too
error[E0382]: use of moved value: `x` (Mir)
--> /home/ariel/Rust/rust-master/src/test/compile-fail/moves-based-on-type-tuple.rs:14:13
|
14 | box (x, x) //~ ERROR use of moved value
| - ^ value used here after move
| |
| value moved here
error: aborting due to 2 previous errors
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.