1 fn address_of_reborrow() {
3 let mut z = &mut [0; 10];
9 y as *const i32; // This is a cast, not a coercion
12 let p: *const [i32; 10] = y;
13 let p: *const dyn Send = y;
14 let p: *const [i32] = y;
17 z as *const [i32; 10];
22 let p: *const [i32; 10] = z;
23 let p: *const dyn Send = z;
24 let p: *const [i32] = z;
32 let p: *mut [i32; 10] = z;
33 let p: *mut dyn Send = z;
34 let p: *mut [i32] = z;
37 // The normal borrows here should be preserved
38 fn borrow_and_cast(mut x: i32) {
39 let p = &x as *const i32;
40 let q = &mut x as *const i32;
41 let r = &mut x as *mut i32;
46 // START rustc.address_of_reborrow.SimplifyCfg-initial.after.mir
49 // _5 = &raw const (*_1); // & to *const casts
51 // _7 = &raw const (*_1);
53 // _11 = &raw const (*_1);
55 // _14 = &raw const (*_1);
57 // _16 = &raw const (*_1);
59 // _17 = &raw const (*_1); // & to *const coercions
61 // _18 = &raw const (*_1);
63 // _20 = &raw const (*_1);
65 // _22 = &raw const (*_1);
67 // _24 = &raw const (*_2); // &mut to *const casts
69 // _26 = &raw const (*_2);
71 // _30 = &raw const (*_2);
73 // _33 = &raw const (*_2);
75 // _34 = &raw const (*_2); // &mut to *const coercions
77 // _35 = &raw const (*_2);
79 // _37 = &raw const (*_2);
81 // _39 = &raw const (*_2);
83 // _41 = &raw mut (*_2); // &mut to *mut casts
85 // _43 = &raw mut (*_2);
87 // _47 = &raw mut (*_2);
89 // _50 = &raw mut (*_2);
91 // _51 = &raw mut (*_2); // &mut to *mut coercions
93 // _52 = &raw mut (*_2);
95 // _54 = &raw mut (*_2);
97 // _56 = &raw mut (*_2);
100 // END rustc.address_of_reborrow.SimplifyCfg-initial.after.mir
102 // START rustc.borrow_and_cast.EraseRegions.after.mir
112 // END rustc.borrow_and_cast.EraseRegions.after.mir