rust/tests/mir-opt/box_expr.rs

22 lines
320 B
Rust
Raw Normal View History

// ignore-wasm32-bare compiled with panic=abort by default
#![feature(box_syntax)]
2020-07-27 14:22:43 -05:00
// EMIT_MIR box_expr.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!");
}
}