fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// MIR for `main` 0 nll 2 3| Free Region Mapping 4| '?0 | Global | ['?0, '?1] 5| '?1 | Local | ['?1] 6| 7| Inferred Region Values 8| '?0 | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '?0, '?1} 9| '?1 | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '?1} 10| '?2 | U0 | {bb1[0..=7], bb2[0..=2]} 11| '?3 | U0 | {bb1[1..=7], bb2[0..=2]} 12| '?4 | U0 | {bb1[4..=7], bb2[0..=2]} 13| 14| Inference Constraints 15| '?0 live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]} 16| '?1 live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]} 17| '?2 live at {bb1[0]} 18| '?3 live at {bb1[1..=3]} 19| '?4 live at {bb1[4..=7], bb2[0..=2]} 20| '?2: '?3 due to Assignment at Single(bb1[0]) ($DIR/region_subtyping_basic.rs:18:13: 18:18 (#0) 21| '?3: '?4 due to Assignment at Single(bb1[3]) ($DIR/region_subtyping_basic.rs:19:13: 19:14 (#0) 22| 23fn main() -> () { 24 let mut _0: (); 25 let mut _1: [usize; ValTree(Leaf(0x00000003): usize)]; 26 let _3: usize; 27 let mut _4: usize; 28 let mut _5: bool; 29 let mut _7: bool; 30 let _8: bool; 31 let mut _9: usize; 32 let _10: bool; 33 scope 1 { 34 debug v => _1; 35 let _2: &'?3 usize; 36 scope 2 { 37 debug p => _2; 38 let _6: &'?4 usize; 39 scope 3 { 40 debug q => _6; 41 } 42 } 43 } 44 45 bb0: { 46 StorageLive(_1); 47 _1 = [const ConstValue(Scalar(0x00000001): usize), const ConstValue(Scalar(0x00000002): usize), const ConstValue(Scalar(0x00000003): usize)]; 48 FakeRead(ForLet(None), _1); 49 StorageLive(_2); 50 StorageLive(_3); 51 _3 = const ConstValue(Scalar(0x00000000): usize); 52 _4 = Len(_1); 53 _5 = Lt(_3, _4); 54 assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; 55 } 56 57 bb1: { 58 _2 = &'?2 _1[_3]; 59 FakeRead(ForLet(None), _2); 60 StorageLive(_6); 61 _6 = _2; 62 FakeRead(ForLet(None), _6); 63 StorageLive(_7); 64 _7 = const ConstValue(Scalar(0x01): bool); 65 switchInt(move _7) -> [0: bb4, otherwise: bb2]; 66 } 67 68 bb2: { 69 StorageLive(_8); 70 StorageLive(_9); 71 _9 = (*_6); 72 _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; 73 } 74 75 bb3: { 76 StorageDead(_9); 77 StorageDead(_8); 78 _0 = const ConstValue(ZeroSized: ()); 79 goto -> bb6; 80 } 81 82 bb4: { 83 StorageLive(_10); 84 _10 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(const ConstValue(Scalar(0x00000016): usize)) -> [return: bb5, unwind: bb7]; 85 } 86 87 bb5: { 88 StorageDead(_10); 89 _0 = const ConstValue(ZeroSized: ()); 90 goto -> bb6; 91 } 92 93 bb6: { 94 StorageDead(_7); 95 StorageDead(_6); 96 StorageDead(_3); 97 StorageDead(_2); 98 StorageDead(_1); 99 return; 100 } 101 102 bb7 (cleanup): { 103 resume; 104 } 105}