fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.8 KiB64 linesraw
1- // MIR for `drop` before Inline
2+ // MIR for `drop` after Inline
3  
4  fn drop(_1: *mut Vec<A>, _2: *mut Option<B>) -> () {
5      debug a => _1;
6      debug b => _2;
7      let mut _0: ();
8      let _3: ();
9      let mut _4: *mut std::vec::Vec<A>;
10      let mut _5: *mut std::option::Option<B>;
11      scope 1 {
12+         scope 3 (inlined std::ptr::drop_in_place::<Vec<A>> - shim(Some(Vec<A>))) {
13+             let mut _6: &mut std::vec::Vec<A>;
14+             let mut _7: ();
15+         }
16      }
17      scope 2 {
18+         scope 4 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) {
19+             let mut _8: isize;
20+             let mut _9: isize;
21+         }
22      }
23  
24      bb0: {
25          StorageLive(_3);
26          StorageLive(_4);
27          _4 = _1;
28-         _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> [return: bb1, unwind unreachable];
29+         StorageLive(_6);
30+         StorageLive(_7);
31+         _6 = &mut (*_4);
32+         _7 = <Vec<A> as Drop>::drop(move _6) -> [return: bb2, unwind unreachable];
33      }
34  
35      bb1: {
36+         StorageDead(_7);
37+         StorageDead(_6);
38          StorageDead(_4);
39          StorageDead(_3);
40          StorageLive(_5);
41          _5 = _2;
42-         _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind unreachable];
43+         StorageLive(_8);
44+         StorageLive(_9);
45+         _8 = discriminant((*_5));
46+         switchInt(move _8) -> [0: bb3, otherwise: bb4];
47      }
48  
49      bb2: {
50+         drop(((*_4).0: alloc::raw_vec::RawVec<A>)) -> [return: bb1, unwind unreachable];
51+     }
52+ 
53+     bb3: {
54+         StorageDead(_9);
55+         StorageDead(_8);
56          StorageDead(_5);
57          return;
58+     }
59+ 
60+     bb4: {
61+         drop((((*_5) as Some).0: B)) -> [return: bb3, unwind unreachable];
62      }
63  }
64