blob: 8180e2f03a79c4c05c62a340283e74839ea79406 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
//! Test that drop_in_place mutably retags the entire place, even for a type that does not need
//! dropping, ensuring among other things that it is writeable
//@error-pattern: /retag .* for Unique permission .* only grants SharedReadOnly permission/
fn main() {
unsafe {
let x = 0u8;
let x = core::ptr::addr_of!(x);
core::ptr::drop_in_place(x.cast_mut());
}
}
|