File: checked_ops.step_forward.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 (84 lines) | stat: -rw-r--r-- 2,164 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
// MIR for `step_forward` after PreCodegen

fn step_forward(_1: u16, _2: usize) -> u16 {
    debug x => _1;
    debug n => _2;
    let mut _0: u16;
    scope 1 (inlined <u16 as Step>::forward) {
        let mut _8: u16;
        scope 2 {
        }
        scope 3 (inlined <u16 as Step>::forward_checked) {
            scope 4 {
                scope 6 (inlined core::num::<impl u16>::checked_add) {
                    let mut _5: (u16, bool);
                    let mut _6: bool;
                    scope 7 (inlined unlikely) {
                        let _7: ();
                    }
                }
            }
            scope 5 (inlined convert::num::ptr_try_from_impls::<impl TryFrom<usize> for u16>::try_from) {
                let mut _3: bool;
                let mut _4: u16;
            }
        }
        scope 8 (inlined Option::<u16>::is_none) {
            scope 9 (inlined Option::<u16>::is_some) {
            }
        }
        scope 10 (inlined core::num::<impl u16>::wrapping_add) {
        }
    }

    bb0: {
        StorageLive(_4);
        StorageLive(_3);
        _3 = Gt(copy _2, const 65535_usize);
        switchInt(move _3) -> [0: bb1, otherwise: bb5];
    }

    bb1: {
        _4 = copy _2 as u16 (IntToInt);
        StorageDead(_3);
        StorageLive(_6);
        StorageLive(_5);
        _5 = AddWithOverflow(copy _1, copy _4);
        _6 = copy (_5.1: bool);
        switchInt(copy _6) -> [0: bb2, otherwise: bb3];
    }

    bb2: {
        StorageDead(_5);
        StorageDead(_6);
        goto -> bb7;
    }

    bb3: {
        _7 = cold_path() -> [return: bb4, unwind unreachable];
    }

    bb4: {
        StorageDead(_5);
        StorageDead(_6);
        goto -> bb6;
    }

    bb5: {
        StorageDead(_3);
        goto -> bb6;
    }

    bb6: {
        assert(!const true, "attempt to compute `{} + {}`, which would overflow", const core::num::<impl u16>::MAX, const 1_u16) -> [success: bb7, unwind unreachable];
    }

    bb7: {
        StorageLive(_8);
        _8 = copy _2 as u16 (IntToInt);
        _0 = Add(copy _1, copy _8);
        StorageDead(_8);
        StorageDead(_4);
        return;
    }
}