File tree Expand file tree Collapse file tree 1 file changed +40
-7
lines changed Expand file tree Collapse file tree 1 file changed +40
-7
lines changed Original file line number Diff line number Diff line change 11
11
// compile-flags: -Z identify_regions
12
12
// ignore-tidy-linelength
13
13
14
- struct D ( i32 ) ;
15
- impl Drop for D { fn drop ( & mut self ) { println ! ( "dropping D({})" , self . 0 ) ; } }
14
+ // Unwinding should EndRegion for in-scope borrows.
16
15
17
16
fn main ( ) {
18
17
let d = D ( 0 ) ;
19
- let a = 3 ;
18
+ let a = 0 ;
20
19
let b = & a;
21
20
foo ( * b) ;
22
21
let c = & a;
23
22
}
24
23
24
+ struct D ( i32 ) ;
25
+ impl Drop for D { fn drop ( & mut self ) { println ! ( "dropping D({})" , self . 0 ) ; } }
26
+
25
27
fn foo ( i : i32 ) {
26
- if i > 3 { panic ! ( "im positive" ) ; }
28
+ if i > 0 { panic ! ( "im positive" ) ; }
27
29
}
28
30
29
31
// END RUST SOURCE
30
32
// START rustc.node4.TypeckMir.before.mir
31
33
// bb0: {
32
34
// StorageLive(_1);
33
- // _1 = const 0usize;
34
- // StorageLive(_2);
35
- // _2 = &'14ce _1;
35
+ // _1 = D::{{constructor}}(const 0i32,);
36
+ // StorageLive(_3);
37
+ // _3 = const 0i32;
38
+ // StorageLive(_4);
39
+ // _4 = &'21ce _3;
40
+ // StorageLive(_6);
41
+ // _6 = (*_4);
42
+ // _5 = foo(_6) -> [return: bb3, unwind: bb2];
43
+ // }
44
+ //
45
+ // bb1: {
46
+ // resume;
47
+ // }
48
+ //
49
+ // bb2: {
50
+ // EndRegion('21ce);
51
+ // drop(_1) -> bb1;
52
+ // }
53
+ //
54
+ // bb3: {
55
+ // StorageDead(_6);
56
+ // StorageLive(_7);
57
+ // _7 = &'33ce _3;
58
+ // StorageDead(_7);
59
+ // EndRegion('33ce);
60
+ // StorageDead(_4);
61
+ // EndRegion('21ce);
62
+ // StorageDead(_3);
63
+ // drop(_1) -> bb4;
64
+ // }
65
+ //
66
+ // bb4: {
67
+ // StorageDead(_1);
68
+ // return;
36
69
// }
37
70
// END rustc.node4.TypeckMir.before.mir
You can’t perform that action at this time.
0 commit comments