rust/src/test/mir-opt/box_expr.rs
2020-04-07 15:09:01 +00:00

21 lines
317 B
Rust

// ignore-wasm32-bare compiled with panic=abort by default
#![feature(box_syntax)]
// EMIT_MIR rustc.main.ElaborateDrops.before.mir
fn main() {
let x = box S::new();
drop(x);
}
struct S;
impl S {
fn new() -> Self { S }
}
impl Drop for S {
fn drop(&mut self) {
println!("splat!");
}
}