@@ -11,6 +11,10 @@ impl Test {
11
11
fn foo_shr < ' x > ( & self , x : & ' x i32 ) -> & ' x i32 { x }
12
12
}
13
13
14
+ impl Drop for Test {
15
+ fn drop ( & mut self ) { }
16
+ }
17
+
14
18
fn main ( ) {
15
19
let mut x = 0 ;
16
20
{
@@ -60,10 +64,12 @@ fn main() {
60
64
// ...
61
65
// bb0: {
62
66
// ...
63
- // _3 = const Test::foo(move _4, move _6) -> bb1 ;
67
+ // _3 = const Test::foo(move _4, move _6) -> [return: bb2, unwind: bb3] ;
64
68
// }
65
69
//
66
- // bb1: {
70
+ // ...
71
+ //
72
+ // bb2: {
67
73
// Retag(_3);
68
74
// ...
69
75
// _9 = move _3;
@@ -80,25 +86,20 @@ fn main() {
80
86
// _12 = move _13 as *mut i32 (Misc);
81
87
// Retag([raw] _12);
82
88
// ...
83
- // _16 = move _17(move _18) -> bb2 ;
89
+ // _16 = move _17(move _18) -> bb5 ;
84
90
// }
85
91
//
86
- // bb2 : {
92
+ // bb5 : {
87
93
// Retag(_16);
88
94
// ...
89
- // _20 = const Test::foo_shr(move _21, move _23) -> bb3;
90
- // }
91
- //
92
- // bb3: {
93
- // ...
94
- // return;
95
+ // _20 = const Test::foo_shr(move _21, move _23) -> [return: bb6, unwind: bb7];
95
96
// }
96
97
//
97
98
// ...
98
99
// }
99
100
// END rustc.main.EraseRegions.after.mir
100
101
// START rustc.main-{{closure}}.EraseRegions.after.mir
101
- // fn main::{{closure}}#0(_1: &[closure@HirId { owner: DefIndex(20 ), local_id: 72 }], _2: &i32) -> &i32 {
102
+ // fn main::{{closure}}#0(_1: &[closure@HirId { owner: DefIndex(22 ), local_id: 72 }], _2: &i32) -> &i32 {
102
103
// ...
103
104
// bb0: {
104
105
// Retag([fn entry] _1);
@@ -113,3 +114,17 @@ fn main() {
113
114
// }
114
115
// }
115
116
// END rustc.main-{{closure}}.EraseRegions.after.mir
117
+ // START rustc.ptr-real_drop_in_place.Test.SimplifyCfg-make_shim.after.mir
118
+ // fn std::ptr::real_drop_in_place(_1: &mut Test) -> () {
119
+ // ...
120
+ // bb0: {
121
+ // Retag([raw] _1);
122
+ // _2 = &mut (*_1);
123
+ // _3 = const <Test as std::ops::Drop>::drop(move _2) -> bb1;
124
+ // }
125
+ //
126
+ // bb1: {
127
+ // return;
128
+ // }
129
+ // }
130
+ // END rustc.ptr-real_drop_in_place.Test.SimplifyCfg-make_shim.after.mir
0 commit comments