2018-09-15 09:35:37 -05:00
|
|
|
fn main() {
|
|
|
|
// Not using the () type here, as writes of that type do not even have MIR generated.
|
|
|
|
// Also not assigning directly as that's array initialization, not assignment.
|
|
|
|
let zst_val = [1u8; 0];
|
2019-04-21 06:18:05 -05:00
|
|
|
unsafe { *std::ptr::null_mut() = zst_val }; //~ ERROR invalid use of NULL pointer
|
2018-09-15 09:35:37 -05:00
|
|
|
}
|