2019-10-18 14:47:54 -07:00
|
|
|
// ignore-wasm32-bare compiled with panic=abort by default
|
2017-11-26 10:39:16 -08:00
|
|
|
|
2023-02-27 13:07:44 +00:00
|
|
|
#![feature(rustc_attrs, stmt_expr_attributes)]
|
2017-08-14 14:10:05 +03:00
|
|
|
|
2020-07-27 21:22:43 +02:00
|
|
|
// EMIT_MIR box_expr.main.ElaborateDrops.before.mir
|
2017-08-14 14:10:05 +03:00
|
|
|
fn main() {
|
2023-02-27 13:07:44 +00:00
|
|
|
let x = #[rustc_box]
|
|
|
|
Box::new(S::new());
|
2017-08-14 14:10:05 +03:00
|
|
|
drop(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
2023-02-27 13:07:44 +00:00
|
|
|
fn new() -> Self {
|
|
|
|
S
|
|
|
|
}
|
2017-08-14 14:10:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Drop for S {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
println!("splat!");
|
|
|
|
}
|
|
|
|
}
|