| 1 |
pub struct AA { |
| 2 |
pub data: [u8; 10], |
| 3 |
} |
| 4 |
|
| 5 |
impl AA { |
| 6 |
pub const fn new() -> Self { |
| 7 |
let mut res: AA = AA { data: [0; 10] }; |
| 8 |
res.data[0] = 5; |
| 9 |
res |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
static mut BB: AA = AA::new(); |
| 14 |
|
| 15 |
fn main() { |
| 16 |
let _ptr = unsafe { &mut BB }; |
| 17 |
} |