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 // compile-flags: -Z identify_regions -Z span_free_formats -Z emit-end-regions
12 // ignore-tidy-linelength
14 // This test models a scenario that arielb1 found during review.
15 // Namely, any filtering of EndRegions must ensure to continue to emit
16 // any necessary EndRegions that occur earlier in the source than the
17 // first borrow involving that region.
19 // It is tricky to actually construct examples of this, which is the
20 // main reason that I am keeping this test even though I have now
21 // removed the pre-filter that motivated the test in the first place.
24 let mut second_iter = false;
30 break 'a; // want to generate `EndRegion('a)` here
40 // START rustc.main.SimplifyCfg-qualify-consts.after.mir
48 // let mut _4: &'33_0rs i32;
67 // switchInt(move _7) -> [0u8: bb3, otherwise: bb2];
72 // EndRegion('33_0rs);
87 // END rustc.main.SimplifyCfg-qualify-consts.after.mir