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 // ignore-tidy-linelength
12 // compile-flags: -Z verbose -Z mir-emit-validate=1
21 // These internal unsafe functions should have no effect on the code generation.
22 unsafe fn _unused1() {}
23 fn _unused2(x: *const i32) -> i32 { unsafe { *x }}
25 let t = Test { x: 0 };
31 // START rustc.main.EraseRegions.after.mir
38 // let _2: &ReErased Test;
45 // let mut _4: &ReErased i32;
46 // let mut _5: &ReErased i32;
49 // _1 = Test { x: const 0i32 };
51 // Validate(Suspend(ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 })), [_1: Test]);
53 // Validate(Acquire, [(*_2): Test/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);
56 // Validate(Suspend(ReScope(Node(ItemLocalId(18)))), [((*_2).0: i32): i32/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);
57 // _5 = &ReErased ((*_2).0: i32);
58 // Validate(Acquire, [(*_5): i32/ReScope(Node(ItemLocalId(18))) (imm)]);
59 // Validate(Suspend(ReScope(Node(ItemLocalId(18)))), [(*_5): i32/ReScope(Node(ItemLocalId(18))) (imm)]);
60 // _4 = &ReErased (*_5);
61 // Validate(Acquire, [(*_4): i32/ReScope(Node(ItemLocalId(18))) (imm)]);
62 // Validate(Release, [_3: (), _4: &ReScope(Node(ItemLocalId(18))) i32]);
63 // _3 = const foo(move _4) -> bb1;
66 // Validate(Acquire, [_3: ()]);
67 // EndRegion(ReScope(Node(ItemLocalId(18))));
71 // EndRegion(ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }));
77 // END rustc.main.EraseRegions.after.mir