fork/rust

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

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

master
1.4 KiB71 linesraw
1// MIR for `main` before ElaborateDrops
2
3fn main() -> () {
4    let mut _0: ();
5    let _1: std::boxed::Box<S>;
6    let mut _2: usize;
7    let mut _3: usize;
8    let mut _4: *mut u8;
9    let mut _5: std::boxed::Box<S>;
10    let _6: ();
11    let mut _7: std::boxed::Box<S>;
12    scope 1 {
13        debug x => _1;
14    }
15    scope 2 {
16    }
17
18    bb0: {
19        StorageLive(_1);
20        _2 = SizeOf(S);
21        _3 = AlignOf(S);
22        _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind: bb9];
23    }
24
25    bb1: {
26        StorageLive(_5);
27        _5 = ShallowInitBox(move _4, S);
28        (*_5) = S::new() -> [return: bb2, unwind: bb8];
29    }
30
31    bb2: {
32        _1 = move _5;
33        drop(_5) -> [return: bb3, unwind: bb9];
34    }
35
36    bb3: {
37        StorageDead(_5);
38        StorageLive(_6);
39        StorageLive(_7);
40        _7 = move _1;
41        _6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6];
42    }
43
44    bb4: {
45        StorageDead(_7);
46        StorageDead(_6);
47        _0 = const ();
48        drop(_1) -> [return: bb5, unwind: bb9];
49    }
50
51    bb5: {
52        StorageDead(_1);
53        return;
54    }
55
56    bb6 (cleanup): {
57        drop(_7) -> [return: bb7, unwind terminate(cleanup)];
58    }
59
60    bb7 (cleanup): {
61        drop(_1) -> [return: bb9, unwind terminate(cleanup)];
62    }
63
64    bb8 (cleanup): {
65        drop(_5) -> [return: bb9, unwind terminate(cleanup)];
66    }
67
68    bb9 (cleanup): {
69        resume;
70    }
71}