fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `main` before DataflowConstProp 2+ // MIR for `main` after DataflowConstProp 3 4 fn main() -> () { 5 let mut _0: (); 6 let _1: A; 7 let mut _2: std::boxed::Box<[bool]>; 8 scope 1 { 9 debug a => _1; 10 } 11 scope 2 (inlined <Box<[bool]> as Default>::default) { 12 let _3: std::ptr::Unique<[bool]>; 13 let mut _4: std::ptr::Unique<[bool; 0]>; 14 scope 3 { 15 debug ptr => _3; 16 } 17 scope 4 (inlined Unique::<[bool; 0]>::dangling) { 18 let mut _5: std::ptr::NonNull<[bool; 0]>; 19 scope 5 (inlined NonNull::<[bool; 0]>::dangling) { 20 let mut _7: usize; 21 scope 6 { 22 let _6: *mut [bool; 0]; 23 scope 7 { 24 debug ptr => _6; 25 scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) { 26 debug ptr => _6; 27 let mut _8: *const [bool; 0]; 28 scope 12 { 29 scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) { 30 debug ptr => _6; 31 scope 14 (inlined ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) { 32 debug self => _6; 33 let mut _9: *mut u8; 34 scope 15 { 35 scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) { 36 debug ptr => _9; 37 scope 17 (inlined ptr::mut_ptr::<impl *mut u8>::addr) { 38 debug self => _9; 39 scope 18 { 40 scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) { 41 debug self => _9; 42 } 43 } 44 } 45 } 46 } 47 } 48 } 49 } 50 } 51 } 52 scope 8 (inlined align_of::<[bool; 0]>) { 53 } 54 scope 9 (inlined invalid_mut::<[bool; 0]>) { 55 debug addr => _7; 56 scope 10 { 57 } 58 } 59 } 60 } 61 } 62 } 63 64 bb0: { 65 StorageLive(_1); 66 StorageLive(_2); 67 StorageLive(_3); 68 StorageLive(_4); 69 StorageLive(_5); 70 StorageLive(_6); 71 StorageLive(_7); 72 _7 = const 1_usize; 73 _6 = const {0x1 as *mut [bool; 0]}; 74 StorageDead(_7); 75 StorageLive(_8); 76 StorageLive(_9); 77 _8 = const {0x1 as *const [bool; 0]}; 78 _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; 79 StorageDead(_9); 80 StorageDead(_8); 81 StorageDead(_6); 82 _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }}; 83 StorageDead(_5); 84 _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; 85 StorageDead(_4); 86 _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); 87 StorageDead(_3); 88 _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }; 89 StorageDead(_2); 90 _0 = const (); 91 drop(_1) -> [return: bb1, unwind: bb2]; 92 } 93 94 bb1: { 95 StorageDead(_1); 96 return; 97 } 98 99 bb2 (cleanup): { 100 resume; 101 } 102 } 103 104 alloc11 (size: 8, align: 4) { 105 01 00 00 00 00 00 00 00 │ ........ 106 } 107 108 alloc10 (size: 8, align: 4) { 109 01 00 00 00 00 00 00 00 │ ........ 110 } 111 112 alloc7 (size: 8, align: 4) { 113 01 00 00 00 00 00 00 00 │ ........ 114 } 115