fork/rust

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

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

master
1.3 KiB61 linesraw
1// MIR for `main` after built
2
3fn main() -> () {
4    let mut _0: ();
5    let mut _1: usize;
6    let mut _3: Foo;
7    let mut _4: Foo;
8    let mut _5: u64;
9    let _6: usize;
10    let mut _7: usize;
11    let mut _8: bool;
12    scope 1 {
13        let _2: [Foo; 2];
14        scope 2 {
15            debug f => _2;
16            scope 3 {
17            }
18            scope 4 {
19            }
20        }
21    }
22
23    bb0: {
24        StorageLive(_1);
25        _1 = std::mem::size_of::<Foo>() -> [return: bb1, unwind: bb3];
26    }
27
28    bb1: {
29        PlaceMention(_1);
30        StorageDead(_1);
31        StorageLive(_2);
32        StorageLive(_3);
33        _3 = Foo { a: const 42_u64 };
34        StorageLive(_4);
35        _4 = Foo { a: const 10_u64 };
36        _2 = [move _3, move _4];
37        StorageDead(_4);
38        StorageDead(_3);
39        FakeRead(ForLet(None), _2);
40        StorageLive(_5);
41        StorageLive(_6);
42        _6 = const 0_usize;
43        _7 = Len(_2);
44        _8 = Lt(_6, _7);
45        assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb2, unwind: bb3];
46    }
47
48    bb2: {
49        _5 = (_2[_6].0: u64);
50        PlaceMention(_5);
51        StorageDead(_6);
52        StorageDead(_5);
53        _0 = const ();
54        StorageDead(_2);
55        return;
56    }
57
58    bb3 (cleanup): {
59        resume;
60    }
61}