rust/tests/mir-opt/issue_62289.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
345 B
Rust
Raw Normal View History

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