fork/rust

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

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

master
3.2 KiB130 linesraw
1// MIR for `forward_loop` after PreCodegen
2
3fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
4    debug start => _1;
5    debug end => _2;
6    debug f => _3;
7    let mut _0: ();
8    let mut _4: std::ops::Range<u32>;
9    let mut _5: std::ops::Range<u32>;
10    let mut _9: std::option::Option<u32>;
11    let mut _12: isize;
12    let mut _14: &impl Fn(u32);
13    let mut _15: (u32,);
14    let _16: ();
15    let mut _17: &mut std::ops::Range<u32>;
16    scope 1 {
17        debug iter => _5;
18        let _13: u32;
19        scope 2 {
20            debug x => _13;
21        }
22        scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
23            debug self => _17;
24            scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
25                debug self => _17;
26                let mut _8: bool;
27                let _10: u32;
28                let mut _11: u32;
29                let mut _18: &u32;
30                let mut _19: &u32;
31                scope 6 {
32                    debug old => _10;
33                    scope 7 {
34                    }
35                }
36                scope 8 (inlined cmp::impls::<impl PartialOrd for u32>::lt) {
37                    debug self => _18;
38                    debug other => _19;
39                    let mut _6: u32;
40                    let mut _7: u32;
41                }
42            }
43        }
44    }
45    scope 3 (inlined <std::ops::Range<u32> as IntoIterator>::into_iter) {
46        debug self => _4;
47    }
48
49    bb0: {
50        _4 = std::ops::Range::<u32> { start: _1, end: _2 };
51        StorageLive(_5);
52        _5 = move _4;
53        goto -> bb1;
54    }
55
56    bb1: {
57        StorageLive(_9);
58        StorageLive(_10);
59        StorageLive(_8);
60        StorageLive(_18);
61        StorageLive(_19);
62        StorageLive(_6);
63        _6 = (_5.0: u32);
64        StorageLive(_7);
65        _7 = (_5.1: u32);
66        _8 = Lt(move _6, move _7);
67        StorageDead(_7);
68        StorageDead(_6);
69        switchInt(move _8) -> [0: bb2, otherwise: bb3];
70    }
71
72    bb2: {
73        StorageDead(_19);
74        StorageDead(_18);
75        _9 = Option::<u32>::None;
76        goto -> bb5;
77    }
78
79    bb3: {
80        StorageDead(_19);
81        StorageDead(_18);
82        _10 = (_5.0: u32);
83        StorageLive(_11);
84        _11 = <u32 as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind unreachable];
85    }
86
87    bb4: {
88        (_5.0: u32) = move _11;
89        StorageDead(_11);
90        _9 = Option::<u32>::Some(_10);
91        goto -> bb5;
92    }
93
94    bb5: {
95        StorageDead(_8);
96        StorageDead(_10);
97        _12 = discriminant(_9);
98        switchInt(move _12) -> [0: bb6, 1: bb8, otherwise: bb10];
99    }
100
101    bb6: {
102        StorageDead(_9);
103        StorageDead(_5);
104        drop(_3) -> [return: bb7, unwind unreachable];
105    }
106
107    bb7: {
108        return;
109    }
110
111    bb8: {
112        _13 = ((_9 as Some).0: u32);
113        StorageLive(_14);
114        _14 = &_3;
115        StorageLive(_15);
116        _15 = (_13,);
117        _16 = <impl Fn(u32) as Fn<(u32,)>>::call(move _14, move _15) -> [return: bb9, unwind unreachable];
118    }
119
120    bb9: {
121        StorageDead(_15);
122        StorageDead(_14);
123        StorageDead(_9);
124        goto -> bb1;
125    }
126
127    bb10: {
128        unreachable;
129    }
130}