mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
22 lines
320 B
Rust
22 lines
320 B
Rust
// ignore-wasm32-bare compiled with panic=abort by default
|
|
|
|
#![feature(box_syntax)]
|
|
|
|
// 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!");
|
|
}
|
|
}
|