1 // Copyright 2012-2016 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 // Test for the subregion constraints. In this case, the region R3 on
12 // `p` includes two disjoint regions of the control-flow graph. The
13 // borrows in `&v[0]` and `&v[1]` each (in theory) have to outlive R3,
14 // but only at a particular point, and hence they wind up including
17 // compile-flags:-Znll -Zverbose
18 // ^^^^^^^^^ force compiler to dump more region information
22 fn use_x(_: usize) -> bool { true }
25 let mut v = [1, 2, 3];
38 // START rustc.main.nll.0.mir
39 // | '_#1r: {bb2[1], bb3[0], bb3[1]}
41 // | '_#3r: {bb8[2], bb8[3], bb8[4]}
42 // | '_#4r: {bb2[1], bb3[0], bb3[1], bb8[2], bb8[3], bb8[4]}
44 // let mut _2: &'_#4r usize;
46 // _2 = &'_#1r _1[_3];
48 // _2 = &'_#3r (*_10);
49 // END rustc.main.nll.0.mir