Closed
Description
struct C;
impl Drop for C {
fn drop(&mut self) {}
}
fn main() {
{
let mut c = C;
unsafe { *(&mut c as *mut C as *mut u8) = 1; }
}
println!("Hello World");
}
This produces absolutely zero output in the playground because it generates a SIGTRAP and kills the program. Of course, it's hard to do much at this point because the program is in an unknown, probably-corrupt state, but we could at least print a message to stderr noting what happened.
Originally reported at https://internals.rust-lang.org/t/im-moving-away-heres-my-two-cents/3767 .