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