2023-10-16 17:36:39 +00:00
|
|
|
// skip-filecheck
|
2019-07-03 12:25:27 +00:00
|
|
|
// check that we don't forget to drop the Box if we early return before
|
|
|
|
// initializing it
|
2023-06-08 07:18:34 +00:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2019-07-03 12:25:27 +00:00
|
|
|
|
2023-02-27 13:07:44 +00:00
|
|
|
#![feature(rustc_attrs)]
|
2019-07-03 12:25:27 +00:00
|
|
|
|
2020-07-27 19:22:43 +00:00
|
|
|
// EMIT_MIR issue_62289.test.ElaborateDrops.before.mir
|
2019-07-03 12:25:27 +00:00
|
|
|
fn test() -> Option<Box<u32>> {
|
2023-02-27 13:07:44 +00:00
|
|
|
Some(
|
|
|
|
#[rustc_box]
|
|
|
|
Box::new(None?),
|
|
|
|
)
|
2019-07-03 12:25:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test();
|
|
|
|
}
|