2023-06-08 07:18:34 +00:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2017-11-26 18:39:16 +00:00
|
|
|
|
2023-02-27 13:07:44 +00:00
|
|
|
#![feature(rustc_attrs, stmt_expr_attributes)]
|
2017-08-14 11:10:05 +00:00
|
|
|
|
2020-07-27 19:22:43 +00:00
|
|
|
// EMIT_MIR box_expr.main.ElaborateDrops.before.mir
|
2017-08-14 11:10:05 +00:00
|
|
|
fn main() {
|
2023-02-27 13:07:44 +00:00
|
|
|
let x = #[rustc_box]
|
|
|
|
Box::new(S::new());
|
2017-08-14 11:10:05 +00:00
|
|
|
drop(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
2023-02-27 13:07:44 +00:00
|
|
|
fn new() -> Self {
|
|
|
|
S
|
|
|
|
}
|
2017-08-14 11:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Drop for S {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
println!("splat!");
|
|
|
|
}
|
|
|
|
}
|