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