Change:
The revision system lets encode different sets of errors for different invocations of the compiler. and normally attempts to catch cases where you left out expected error messages by saying "if you have any annotation in your file, then the set of such annotations needs to match the same set of errors that are actually emitted. However, if you combine these features, then for each revision (call it ) in the revisions list, at least one of your errors currently need to be written with the revision system in mind, e.g. If none of the error annotations include a revision (i.e., if they are all ), then thinks that the test has no error annotations, and thus treats it as a case where the compiler's error output is blindly accepted. That seems bad.
cc
This is surely no longer the case, because and annotations are now mandatory?
With annotation for warnings and errors being mandatory , and additionally annotations applying to all revisions , this should be non-issue.

Discussion:
<ins> error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:37:9 | LL |     let _x = a.x; |         -- value moved here LL |     //[ast]~^ value moved here LL |     let _y = a.y; //[ast]~ ERROR use of moved |         ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:46:9 | LL |     let _x = a.x; |         -- value moved here LL |     //[ast]~^ value moved here LL |     let _y = a.y; //[ast]~ ERROR use of moved |         ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:55:15 | LL |     let _x = a.x; |         -- value moved here LL |     //[ast]~^ value moved here LL |     let _y = &a.y; //[ast]~ ERROR use of moved |               ^^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:63:9 | LL |     let _x = &a.x; |               --- borrow of `a.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0503]: cannot use `a.y` because it was mutably borrowed --> $DIR/borrowck-box-insensitivity.rs:71:9 | LL |     let _x = &mut a.x; |                   --- borrow of `a.x` occurs here LL |     let _y = a.y; //[ast]~ ERROR cannot use |         ^^ use of borrowed `a.x` error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:77:9 | LL |     let _x = &mut a.x; |                   --- borrow of `a.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`) --> $DIR/borrowck-box-insensitivity.rs:85:15 | LL |     let _x = &mut a.x; |                   --- mutable borrow occurs here (via `a.x`) LL |     let _y = &a.y; //[ast]~ ERROR cannot borrow |               ^^^ immutable borrow occurs here (via `a.y`) ... LL | } | - mutable borrow ends here error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`) --> $DIR/borrowck-box-insensitivity.rs:92:19 | LL |     let _x = &a.x; |               --- immutable borrow occurs here (via `a.x`) LL |     let _y = &mut a.y; //[ast]~ ERROR cannot borrow |                   ^^^ mutable borrow occurs here (via `a.y`) ... LL | } | - immutable borrow ends here error[E0382]: use of collaterally moved value: `a.y` --> $DIR/borrowck-box-insensitivity.rs:100:9 | LL |     let _x = a.x.x; |         -- value moved here LL |     //[ast]~^ value moved here LL |     let _y = a.y; //[ast]~ ERROR use of collaterally moved |         ^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of collaterally moved value: `a.y` --> $DIR/borrowck-box-insensitivity.rs:108:9 | LL |     let _x = a.x.x; |         -- value moved here LL |     //[ast]~^ value moved here LL |     let _y = a.y; //[ast]~ ERROR use of collaterally moved |         ^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of collaterally moved value: `a.y` --> $DIR/borrowck-box-insensitivity.rs:116:15 | LL |     let _x = a.x.x; |         -- value moved here LL |     //[ast]~^ value moved here LL |     let _y = &a.y; //[ast]~ ERROR use of collaterally moved |               ^^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:124:9 | LL |     let _x = &a.x.x; |               ----- borrow of `a.x.x` occurs here LL |     //[ast]~^ borrow of `a.x.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0503]: cannot use `a.y` because it was mutably borrowed --> $DIR/borrowck-box-insensitivity.rs:132:9 | LL |     let _x = &mut a.x.x; |                   ----- borrow of `a.x.x` occurs here LL |     let _y = a.y; //[ast]~ ERROR cannot use |         ^^ use of borrowed `a.x.x` error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:138:9 | LL |     let _x = &mut a.x.x; |                   ----- borrow of `a.x.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable --> $DIR/borrowck-box-insensitivity.rs:147:15 | LL |     let _x = &mut a.x.x; |                   ----- mutable borrow occurs here LL |     //[ast]~^ mutable borrow occurs here LL |     let _y = &a.y; //[ast]~ ERROR cannot borrow |               ^^^ immutable borrow occurs here ... LL | } | - mutable borrow ends here error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable --> $DIR/borrowck-box-insensitivity.rs:155:19 | LL |     let _x = &a.x.x; |               ----- immutable borrow occurs here LL |     //[ast]~^ immutable borrow occurs here LL |     let _y = &mut a.y; //[ast]~ ERROR cannot borrow |                   ^^^ mutable borrow occurs here ... LL | } | - immutable borrow ends here error: aborting due to 16 previous errors Some errors occurred: E0382, E0502, E0503, E0505. For more information about an error, try `rustc --explain E0382`. </ins>

<ins> error: compilation successful --> $DIR/borrowck-box-insensitivity.rs:160:1 | LL | / fn main() { //[mir]~ ERROR compilation successful LL | |     copy_after_move(); LL | |     move_after_move(); LL | |     borrow_after_move(); ...  | LL | |     mut_borrow_after_borrow_nested(); LL | | } | |_^ error: aborting due to previous error </ins>

<del> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. </del> <ins> // This test is an artifact of the old policy that `Box<T>` should not // be treated specially by the AST-borrowck. </ins> // <del> // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. </del> <ins> // NLL goes back to treating `Box<T>` specially (namely, knowing that // it uniquely owns the data it holds). See rust-lang/rfcs#130. // revisions: ast mir //[ast] compile-flags: -Z borrowck=ast //[mir] compile-flags: -Z borrowck=mir // ignore-compare-mode-nll </ins> #![feature(box_syntax, rustc_attrs)] struct A {

fn copy_after_move() { let a: Box<_> = box A { x: box 0, y: 1 }; let _x = a.x; <del> //~^ value moved here let _y = a.y; //~ ERROR use of moved //~^ move occurs because `a.x` has type `std::boxed::Box<isize>` //~| value used here after move </del> <ins> //[ast]~^ value moved here let _y = a.y; //[ast]~ ERROR use of moved //[ast]~^ move occurs because `a.x` has type `std::boxed::Box<isize>` //[ast]~| value used here after move </ins> } fn move_after_move() { let a: Box<_> = box B { x: box 0, y: box 1 }; let _x = a.x; <del> //~^ value moved here let _y = a.y; //~ ERROR use of moved //~^ move occurs because `a.x` has type `std::boxed::Box<isize>` //~| value used here after move </del> <ins> //[ast]~^ value moved here let _y = a.y; //[ast]~ ERROR use of moved //[ast]~^ move occurs because `a.x` has type `std::boxed::Box<isize>` //[ast]~| value used here after move </ins> } fn borrow_after_move() { let a: Box<_> = box A { x: box 0, y: 1 }; let _x = a.x; <del> //~^ value moved here let _y = &a.y; //~ ERROR use of moved //~^ move occurs because `a.x` has type `std::boxed::Box<isize>` //~| value used here after move </del> <ins> //[ast]~^ value moved here let _y = &a.y; //[ast]~ ERROR use of moved //[ast]~^ move occurs because `a.x` has type `std::boxed::Box<isize>` //[ast]~| value used here after move </ins> } fn move_after_borrow() { let a: Box<_> = box B { x: box 0, y: box 1 }; let _x = &a.x; let _y = a.y; <del> //~^ ERROR cannot move //~| move out of </del> <ins> //[ast]~^ ERROR cannot move //[ast]~| move out of use_imm(_x); </ins> } fn copy_after_mut_borrow() { let mut a: Box<_> = box A { x: box 0, y: 1 }; let _x = &mut a.x; <del> let _y = a.y; //~ ERROR cannot use </del> <ins> let _y = a.y; //[ast]~ ERROR cannot use use_mut(_x); </ins> } fn move_after_mut_borrow() { let mut a: Box<_> = box B { x: box 0, y: box 1 }; let _x = &mut a.x; let _y = a.y; <del> //~^ ERROR cannot move //~| move out of </del> <ins> //[ast]~^ ERROR cannot move //[ast]~| move out of use_mut(_x); </ins> } fn borrow_after_mut_borrow() { let mut a: Box<_> = box A { x: box 0, y: 1 }; let _x = &mut a.x; <del> let _y = &a.y; //~ ERROR cannot borrow //~^ immutable borrow occurs here (via `a.y`) </del> <ins> let _y = &a.y; //[ast]~ ERROR cannot borrow //[ast]~^ immutable borrow occurs here (via `a.y`) use_mut(_x); </ins> } fn mut_borrow_after_borrow() { let mut a: Box<_> = box A { x: box 0, y: 1 }; let _x = &a.x; <del> let _y = &mut a.y; //~ ERROR cannot borrow //~^ mutable borrow occurs here (via `a.y`) </del> <ins> let _y = &mut a.y; //[ast]~ ERROR cannot borrow //[ast]~^ mutable borrow occurs here (via `a.y`) use_imm(_x); </ins> } fn copy_after_move_nested() { let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = a.x.x; <del> //~^ value moved here let _y = a.y; //~ ERROR use of collaterally moved //~| value used here after move </del> <ins> //[ast]~^ value moved here let _y = a.y; //[ast]~ ERROR use of collaterally moved //[ast]~| value used here after move </ins> } fn move_after_move_nested() { let a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 }; let _x = a.x.x; <del> //~^ value moved here let _y = a.y; //~ ERROR use of collaterally moved //~| value used here after move </del> <ins> //[ast]~^ value moved here let _y = a.y; //[ast]~ ERROR use of collaterally moved //[ast]~| value used here after move </ins> } fn borrow_after_move_nested() { let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = a.x.x; <del> //~^ value moved here let _y = &a.y; //~ ERROR use of collaterally moved //~| value used here after move </del> <ins> //[ast]~^ value moved here let _y = &a.y; //[ast]~ ERROR use of collaterally moved //[ast]~| value used here after move </ins> } fn move_after_borrow_nested() { let a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 }; let _x = &a.x.x; <del> //~^ borrow of `a.x.x` occurs here </del> <ins> //[ast]~^ borrow of `a.x.x` occurs here </ins> let _y = a.y; <del> //~^ ERROR cannot move //~| move out of </del> <ins> //[ast]~^ ERROR cannot move //[ast]~| move out of use_imm(_x); </ins> } fn copy_after_mut_borrow_nested() { let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = &mut a.x.x; <del> let _y = a.y; //~ ERROR cannot use </del> <ins> let _y = a.y; //[ast]~ ERROR cannot use use_mut(_x); </ins> } fn move_after_mut_borrow_nested() { let mut a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 }; let _x = &mut a.x.x; let _y = a.y; <del> //~^ ERROR cannot move //~| move out of </del> <ins> //[ast]~^ ERROR cannot move //[ast]~| move out of use_mut(_x); </ins> } fn borrow_after_mut_borrow_nested() { let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = &mut a.x.x; <del> //~^ mutable borrow occurs here let _y = &a.y; //~ ERROR cannot borrow //~^ immutable borrow occurs here </del> <ins> //[ast]~^ mutable borrow occurs here let _y = &a.y; //[ast]~ ERROR cannot borrow //[ast]~^ immutable borrow occurs here use_mut(_x); </ins> } fn mut_borrow_after_borrow_nested() { let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 }; let _x = &a.x.x; <del> //~^ immutable borrow occurs here let _y = &mut a.y; //~ ERROR cannot borrow //~^ mutable borrow occurs here </del> <ins> //[ast]~^ immutable borrow occurs here let _y = &mut a.y; //[ast]~ ERROR cannot borrow //[ast]~^ mutable borrow occurs here use_imm(_x); </ins> } #[rustc_error] <del> fn main() { </del> <ins> fn main() { //[mir]~ ERROR compilation successful </ins> copy_after_move(); move_after_move(); borrow_after_move();

borrow_after_mut_borrow_nested(); mut_borrow_after_borrow_nested(); } <ins> fn use_mut<T>(_: &mut T) { } fn use_imm<T>(_: &T) { } </ins>

<del> error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:37:9 | LL |     let _x = a.x; |         -- value moved here LL |     //~^ value moved here LL |     let _y = a.y; //~ ERROR use of moved |         ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:46:9 | LL |     let _x = a.x; |         -- value moved here LL |     //~^ value moved here LL |     let _y = a.y; //~ ERROR use of moved |         ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:55:15 | LL |     let _x = a.x; |         -- value moved here LL |     //~^ value moved here LL |     let _y = &a.y; //~ ERROR use of moved |               ^^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:63:9 | LL |     let _x = &a.x; |               --- borrow of `a.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0503]: cannot use `a.y` because it was mutably borrowed --> $DIR/borrowck-box-insensitivity.rs:71:9 | LL |     let _x = &mut a.x; |                   --- borrow of `a.x` occurs here LL |     let _y = a.y; //~ ERROR cannot use |         ^^ use of borrowed `a.x` error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:77:9 | LL |     let _x = &mut a.x; |                   --- borrow of `a.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`) --> $DIR/borrowck-box-insensitivity.rs:85:15 | LL |     let _x = &mut a.x; |                   --- mutable borrow occurs here (via `a.x`) LL |     let _y = &a.y; //~ ERROR cannot borrow |               ^^^ immutable borrow occurs here (via `a.y`) LL |     //~^ immutable borrow occurs here (via `a.y`) LL | } | - mutable borrow ends here error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`) --> $DIR/borrowck-box-insensitivity.rs:92:19 | LL |     let _x = &a.x; |               --- immutable borrow occurs here (via `a.x`) LL |     let _y = &mut a.y; //~ ERROR cannot borrow |                   ^^^ mutable borrow occurs here (via `a.y`) LL |     //~^ mutable borrow occurs here (via `a.y`) LL | } | - immutable borrow ends here error[E0382]: use of collaterally moved value: `a.y` --> $DIR/borrowck-box-insensitivity.rs:100:9 | LL |     let _x = a.x.x; |         -- value moved here LL |     //~^ value moved here LL |     let _y = a.y; //~ ERROR use of collaterally moved |         ^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of collaterally moved value: `a.y` --> $DIR/borrowck-box-insensitivity.rs:108:9 | LL |     let _x = a.x.x; |         -- value moved here LL |     //~^ value moved here LL |     let _y = a.y; //~ ERROR use of collaterally moved |         ^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of collaterally moved value: `a.y` --> $DIR/borrowck-box-insensitivity.rs:116:15 | LL |     let _x = a.x.x; |         -- value moved here LL |     //~^ value moved here LL |     let _y = &a.y; //~ ERROR use of collaterally moved |               ^^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:124:9 | LL |     let _x = &a.x.x; |               ----- borrow of `a.x.x` occurs here LL |     //~^ borrow of `a.x.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0503]: cannot use `a.y` because it was mutably borrowed --> $DIR/borrowck-box-insensitivity.rs:132:9 | LL |     let _x = &mut a.x.x; |                   ----- borrow of `a.x.x` occurs here LL |     let _y = a.y; //~ ERROR cannot use |         ^^ use of borrowed `a.x.x` error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:138:9 | LL |     let _x = &mut a.x.x; |                   ----- borrow of `a.x.x` occurs here LL |     let _y = a.y; |         ^^ move out of `a.y` occurs here error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable --> $DIR/borrowck-box-insensitivity.rs:147:15 | LL |     let _x = &mut a.x.x; |                   ----- mutable borrow occurs here LL |     //~^ mutable borrow occurs here LL |     let _y = &a.y; //~ ERROR cannot borrow |               ^^^ immutable borrow occurs here LL |     //~^ immutable borrow occurs here LL | } | - mutable borrow ends here error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable --> $DIR/borrowck-box-insensitivity.rs:155:19 | LL |     let _x = &a.x.x; |               ----- immutable borrow occurs here LL |     //~^ immutable borrow occurs here LL |     let _y = &mut a.y; //~ ERROR cannot borrow |                   ^^^ mutable borrow occurs here LL |     //~^ mutable borrow occurs here LL | } | - immutable borrow ends here error: aborting due to 16 previous errors Some errors occurred: E0382, E0502, E0503, E0505. For more information about an error, try `rustc --explain E0382`. </del>