|
11 | 11 | // ignore-tidy-linelength
|
12 | 12 | // compile-flags: -Z verbose -Z mir-emit-validate=1
|
13 | 13 |
|
14 |
| -fn foo(_x: &mut i32) {} |
| 14 | +struct Test; |
| 15 | + |
| 16 | +impl Test { |
| 17 | + // Make sure we run the pass on a method, not just on bare functions. |
| 18 | + fn foo(&self, _x: &mut i32) {} |
| 19 | +} |
15 | 20 |
|
16 | 21 | fn main() {
|
17 | 22 | let mut x = 0;
|
18 |
| - foo(&mut x); |
| 23 | + Test.foo(&mut x); |
19 | 24 | }
|
20 | 25 |
|
21 | 26 | // END RUST SOURCE
|
22 |
| -// START rustc.node4.EraseRegions.after.mir |
23 |
| -// fn foo(_1: &ReErased mut i32) -> () { |
| 27 | +// START rustc.node10.EraseRegions.after.mir |
24 | 28 | // bb0: {
|
25 |
| -// Validate(Acquire, [_1: &ReFree(DefId { krate: CrateNum(0), node: DefIndex(3) => validate_1/8cd878b::foo[0] }, BrAnon(0)) mut i32]); |
| 29 | +// Validate(Acquire, [_1: &ReFree(DefId { krate: CrateNum(0), node: DefIndex(5) => validate_1/8cd878b::{{impl}}[0]::foo[0] }, BrAnon(0)) Test, _2: &ReFree(DefId { krate: CrateNum(0), node: DefIndex(5) => validate_1/8cd878b::{{impl}}[0]::foo[0] }, BrAnon(1)) mut i32]); |
26 | 30 | // return;
|
27 | 31 | // }
|
28 |
| -// } |
29 |
| -// END rustc.node4.EraseRegions.after.mir |
30 |
| -// START rustc.node11.EraseRegions.after.mir |
| 32 | +// END rustc.node10.EraseRegions.after.mir |
| 33 | +// START rustc.node21.EraseRegions.after.mir |
31 | 34 | // fn main() -> () {
|
32 | 35 | // bb0: {
|
33 |
| -// Validate(Suspend(ReScope(Misc(NodeId(20)))), [_1: i32]); |
34 |
| -// _4 = &ReErased mut _1; |
35 |
| -// Validate(Acquire, [(*_4): i32/ReScope(Misc(NodeId(20)))]); |
36 |
| -// Validate(Suspend(ReScope(Misc(NodeId(20)))), [(*_4): i32/ReScope(Misc(NodeId(20)))]); |
37 |
| -// _3 = &ReErased mut (*_4); |
38 |
| -// Validate(Acquire, [(*_3): i32/ReScope(Misc(NodeId(20)))]); |
39 |
| -// Validate(Release, [_3: &ReScope(Misc(NodeId(20))) mut i32]); |
40 |
| -// _2 = const foo(_3) -> bb1; |
| 36 | +// Validate(Suspend(ReScope(Misc(NodeId(30)))), [_1: i32]); |
| 37 | +// _6 = &ReErased mut _1; |
| 38 | +// Validate(Acquire, [(*_6): i32/ReScope(Misc(NodeId(30)))]); |
| 39 | +// Validate(Suspend(ReScope(Misc(NodeId(30)))), [(*_6): i32/ReScope(Misc(NodeId(30)))]); |
| 40 | +// _5 = &ReErased mut (*_6); |
| 41 | +// Validate(Acquire, [(*_5): i32/ReScope(Misc(NodeId(30)))]); |
| 42 | +// Validate(Release, [_3: &ReScope(Misc(NodeId(30))) Test, _5: &ReScope(Misc(NodeId(30))) mut i32]); |
| 43 | +// _2 = const Test::foo(_3, _5) -> bb1; |
41 | 44 | // }
|
42 | 45 | //
|
43 | 46 | // bb1: {
|
44 | 47 | // Validate(Acquire, [_2: ()]);
|
45 |
| -// EndRegion(ReScope(Misc(NodeId(20)))); |
| 48 | +// EndRegion(ReScope(Misc(NodeId(30)))); |
46 | 49 | // return;
|
47 | 50 | // }
|
48 | 51 | // }
|
49 |
| -// END rustc.node11.EraseRegions.after.mir |
| 52 | +// END rustc.node21.EraseRegions.after.mir |
0 commit comments