File: slice_iter.range_loop.PreCodegen.after.panic-abort.mir

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (105 lines) | stat: -rw-r--r-- 2,851 bytes parent folder | download | duplicates (2)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// MIR for `range_loop` after PreCodegen

fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
    debug slice => _1;
    debug f => _2;
    let mut _0: ();
    let mut _3: usize;
    let mut _4: usize;
    let mut _9: std::option::Option<usize>;
    let mut _11: usize;
    let mut _12: bool;
    let mut _14: &impl Fn(usize, &T);
    let mut _15: (usize, &T);
    let _16: ();
    scope 1 {
        debug ((iter: std::ops::Range<usize>).0: usize) => _4;
        debug ((iter: std::ops::Range<usize>).1: usize) => _3;
        let _10: usize;
        scope 2 {
            debug i => _10;
            let _13: &T;
            scope 3 {
                debug x => _13;
            }
        }
        scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
            scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
                let mut _6: bool;
                let _7: usize;
                let mut _8: usize;
                scope 7 {
                }
                scope 8 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) {
                    let mut _5: usize;
                }
            }
        }
    }
    scope 4 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
    }

    bb0: {
        _3 = PtrMetadata(copy _1);
        StorageLive(_4);
        _4 = const 0_usize;
        goto -> bb1;
    }

    bb1: {
        StorageLive(_9);
        StorageLive(_7);
        StorageLive(_6);
        StorageLive(_5);
        _5 = copy _4;
        _6 = Lt(move _5, copy _3);
        StorageDead(_5);
        switchInt(move _6) -> [0: bb2, otherwise: bb4];
    }

    bb2: {
        StorageDead(_6);
        StorageDead(_7);
        StorageDead(_9);
        StorageDead(_4);
        drop(_2) -> [return: bb3, unwind unreachable];
    }

    bb3: {
        return;
    }

    bb4: {
        _7 = copy _4;
        StorageLive(_8);
        _8 = <usize as Step>::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind unreachable];
    }

    bb5: {
        _4 = move _8;
        StorageDead(_8);
        _9 = Option::<usize>::Some(copy _7);
        StorageDead(_6);
        StorageDead(_7);
        _10 = copy ((_9 as Some).0: usize);
        _11 = Len((*_1));
        _12 = Lt(copy _10, copy _11);
        assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, copy _10) -> [success: bb6, unwind unreachable];
    }

    bb6: {
        _13 = &(*_1)[_10];
        StorageLive(_14);
        _14 = &_2;
        StorageLive(_15);
        _15 = (copy _10, copy _13);
        _16 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _14, move _15) -> [return: bb7, unwind unreachable];
    }

    bb7: {
        StorageDead(_15);
        StorageDead(_14);
        StorageDead(_9);
        goto -> bb1;
    }
}