summaryrefslogtreecommitdiff
path: root/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.rs
blob: 9126b7e8575b05f7fbfaa737185cadc7f4628ff8 (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-in-other-file: /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());
    }
}