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 // compile-flags:-Znll
13 fn can_panic() -> Box<usize> {
18 let mut x = Box::new(22);
23 // - `_1` is the variable corresponding to `x`
25 // - `_1` is live when `can_panic` is called (because it may be dropped)
28 // START rustc.main.nll.0.mir
29 // | Live variables on entry to bb0: []
31 // | Live variables at bb0[0]: []
33 // | Live variables at bb0[1]: []
35 // | Live variables at bb0[2]: []
36 // _2 = const 22usize;
37 // | Live variables at bb0[3]: [_2]
38 // _1 = const <std::boxed::Box<T>>::new(_2) -> bb1;
40 // END rustc.main.nll.0.mir
41 // START rustc.main.nll.0.mir
42 // | Live variables on entry to bb1: [_1 (drop)]
44 // | Live variables at bb1[0]: [_1 (drop)]
46 // | Live variables at bb1[1]: [_1 (drop)]
48 // | Live variables at bb1[2]: [_1 (drop)]
49 // _3 = const can_panic() -> [return: bb2, unwind: bb4];
51 // END rustc.main.nll.0.mir