]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.rs
Auto merge of #105605 - inquisitivecrystal:attr-validation, r=cjgillot
[rust.git] / src / tools / miri / tests / fail / stacked_borrows / drop_in_place_retag.rs
1 //! Test that drop_in_place mutably retags the entire place, even for a type that does not need
2 //! dropping, ensuring among other things that it is writeable
3
4 //@error-pattern: /retag .* for Unique permission .* only grants SharedReadOnly permission/
5
6 fn main() {
7     unsafe {
8         let x = 0u8;
9         let x = core::ptr::addr_of!(x);
10         core::ptr::drop_in_place(x.cast_mut());
11     }
12 }