1 // This is a test that the `#![feature(nll)]` opt-in overrides the
2 // migration mode. The intention here is to emulate the goal behavior
3 // that `--edition 2018` effects on borrowck (modeled here by `-Z
4 // borrowck=migrate`) are themselves overridden by the
5 // `#![feature(nll)]` opt-in.
7 // Therefore, for developer convenience, under `#[feature(nll)]` the
8 // NLL checks will be emitted as errors *even* in the presence of `-Z
11 // revisions: zflag edition
12 //[zflag]compile-flags: -Z borrowck=migrate
13 //[edition]edition:2018
22 (|| { let bar = foo; bar.take() })();
23 //[zflag]~^ ERROR cannot move out of `foo` in pattern guard [E0507]
24 //[edition]~^^ ERROR cannot move out of `foo` in pattern guard [E0507]
27 Some(ref _s) => println!("Note this arm is bogus; the `Some` became `None` in the guard."),
28 _ => println!("Here is some supposedly unreachable code."),