1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // This is a test that the `#![feature(nll)]` opt-in overrides the
12 // migration mode. The intention here is to emulate the goal behavior
13 // that `--edition 2018` effects on borrowck (modeled here by `-Z
14 // borrowck=migrate`) are themselves overridden by the
15 // `#![feature(nll)]` opt-in.
17 // Therefore, for developer convenience, under `#[feature(nll)]` the
18 // NLL checks will be emitted as errors *even* in the presence of `-Z
21 // revisions: zflag edition
22 // [zflag]compile-flags: -Z borrowck=migrate
23 // [edition]compile-flags: --edition 2018
32 (|| { let bar = foo; bar.take() })();
33 //[zflag]~^ ERROR cannot move out of borrowed content [E0507]
34 //[edition]~^^ ERROR cannot move out of borrowed content [E0507]
37 Some(ref _s) => println!("Note this arm is bogus; the `Some` became `None` in the guard."),
38 _ => println!("Here is some supposedly unreachable code."),