about summary refs log tree commit diff
path: root/tests/mir-opt/issue_91633.foo.built.after.mir
blob: 53f48350596ee8cc76a4ed43c70ec7d8ee5bc9e6 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// MIR for `foo` after built

fn foo(_1: Box<[T]>) -> T {
    debug it => _1;
    let mut _0: T;
    let _2: T;
    let mut _3: &T;
    let _4: usize;
    let mut _5: *const [T];
    let mut _6: usize;
    let mut _7: bool;
    scope 1 {
        debug f => _2;
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_3);
        StorageLive(_4);
        _4 = const 0_usize;
        _5 = &raw const (fake) (*_1);
        _6 = PtrMetadata(move _5);
        _7 = Lt(copy _4, copy _6);
        assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _4) -> [success: bb1, unwind: bb5];
    }

    bb1: {
        _3 = &(*_1)[_4];
        _2 = <T as Clone>::clone(move _3) -> [return: bb2, unwind: bb5];
    }

    bb2: {
        StorageDead(_3);
        FakeRead(ForLet(None), _2);
        StorageDead(_4);
        _0 = move _2;
        drop(_2) -> [return: bb3, unwind: bb5];
    }

    bb3: {
        StorageDead(_2);
        drop(_1) -> [return: bb4, unwind: bb6];
    }

    bb4: {
        return;
    }

    bb5 (cleanup): {
        drop(_1) -> [return: bb6, unwind terminate(cleanup)];
    }

    bb6 (cleanup): {
        resume;
    }
}