Closed
Description
Currently, if you pass -Zborrowck-mir
, we output both the AST output (tagged with (Ast)
) and the MIR output (tagged with (Mir)
).
Example:
> cd src/test/compile-fail
> rustc -Zborrowck-mir borrowck/borrowck-unary-move.rs
error[E0505]: cannot move out of `x` because it is borrowed (Ast)
--> borrowck/borrowck-unary-move.rs:17:10
|
16 | let y = &*x;
| -- borrow of `*x` occurs here
17 | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed
| ^ move out of `x` occurs here
error[E0505]: cannot move out of `x` because it is borrowed (Mir)
--> borrowck/borrowck-unary-move.rs:17:10
|
16 | let y = &*x;
| --- borrow of `(*x)` occurs here
17 | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed
| ^ move out of `x` occurs here
error: aborting due to 2 previous errors
I would like to alter the switch to be one where there are three mores:
-Zborrowck=ast -- the default, emits only AST
-Zborrowck=mir -- emits only MIR errors (and doesn't write `(Mir)`)
-Zborrowck=compare -- emits both, like `-Zborrowck-mir` does today.
This will be useful as we progress towards our yearly goal of having a working "demo", since the demo isn't very good if people are seeing the old and new errors. It will also be less annoying for editing the unit tests, since we won't need three copies of each error. And if we want the current output when running by hand, it is still available.