summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir
blob: 6fb107929e6bb4ec1c31c1cfc9254418bce8c3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// MIR for `main` before ElaborateDrops

fn main() -> () {
    let mut _0: ();
    let _1: ();
    let mut _2: std::string::String;
    let mut _3: &str;
    let _4: &str;

    bb0: {
        StorageLive(_1);
        StorageLive(_2);
        StorageLive(_3);
        StorageLive(_4);
        _4 = const "";
        _3 = &(*_4);
        _2 = <str as ToString>::to_string(move _3) -> [return: bb1, unwind continue];
    }

    bb1: {
        StorageDead(_3);
        _1 = std::mem::drop::<String>(move _2) -> [return: bb2, unwind: bb3];
    }

    bb2: {
        StorageDead(_2);
        StorageDead(_4);
        StorageDead(_1);
        _0 = const ();
        return;
    }

    bb3 (cleanup): {
        drop(_2) -> [return: bb4, unwind terminate];
    }

    bb4 (cleanup): {
        resume;
    }
}