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