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 // Basic test for reborrow constraints: the region (`R5`) that appears
12 // in the type of `r_a` must outlive the region (`R7`) that appears in
15 // compile-flags:-Znll -Zverbose
16 // ^^^^^^^^^ force compiler to dump more region information
20 fn use_x(_: &mut i32) -> bool { true }
23 let mut foo: i32 = 22;
24 let r_a: &mut i32 = &mut foo;
25 let r_b: &mut i32 = &mut *r_a;
30 // START rustc.node13.nll.0.mir
31 // | '_#5r: {bb0[6], bb0[7], bb0[8], bb0[9], bb0[10], bb0[11], bb0[12], bb0[13], bb0[14]}
33 // | '_#7r: {bb0[11], bb0[12], bb0[13], bb0[14]}
34 // END rustc.node13.nll.0.mir
35 // START rustc.node13.nll.0.mir
36 // let _2: &'_#5r mut i32;
38 // let _4: &'_#7r mut i32;
39 // END rustc.node13.nll.0.mir