]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/nll/named-lifetimes-basic.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / test / mir-opt / nll / named-lifetimes-basic.rs
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.
4 //
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.
10
11 // Basic test for named lifetime translation. Check that we
12 // instantiate the types that appear in function arguments with
13 // suitable variables and that we setup the outlives relationship
14 // between R0 and R1 properly.
15
16 // compile-flags:-Znll -Zverbose
17 // ^^^^^^^^^ force compiler to dump more region information
18 // ignore-tidy-linelength
19
20 #![allow(warnings)]
21
22 fn use_x<'a, 'b: 'a, 'c>(w: &'a mut i32, x: &'b u32, y: &'a u32, z: &'c u32) -> bool { true }
23
24 fn main() {
25 }
26
27 // END RUST SOURCE
28 // START rustc.use_x.nll.0.mir
29 // | '_#0r: {bb0[0], bb0[1], '_#0r, '_#1r, '_#2r, '_#3r}
30 // | '_#1r: {bb0[0], bb0[1], '_#1r}
31 // | '_#2r: {bb0[0], bb0[1], '_#1r, '_#2r}
32 // | '_#3r: {bb0[0], bb0[1], '_#3r}
33 // fn use_x(_1: &'_#1r mut i32, _2: &'_#2r u32, _3: &'_#1r u32, _4: &'_#3r u32) -> bool {
34 // END rustc.use_x.nll.0.mir