about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass/drop_in_place.rs
blob: cac8d76dd9d4119e43ec95b48ed0f07eeaec84e0 (plain)
1
2
3
4
5
6
7
8
9
10
// Miri currently doesn't require types without drop glue to be
// valid when dropped. This test confirms that behavior.
// This is not a stable guarantee!

use std::ptr;

fn main() {
    let mut not_a_bool = 13u8;
    unsafe { ptr::drop_in_place(&mut not_a_bool as *mut u8 as *mut bool) };
}