diff options
Diffstat (limited to 'tests/crashes/126680.rs')
| -rw-r--r-- | tests/crashes/126680.rs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/crashes/126680.rs b/tests/crashes/126680.rs index b1566d5e6be..dcb6ccad6b4 100644 --- a/tests/crashes/126680.rs +++ b/tests/crashes/126680.rs @@ -8,14 +8,18 @@ use std::path::Path; struct A { pub func: fn(check: Bar, b: Option<&Path>), } -const MY_A: A = A { - func: |check, b| { - if check { - () - } else if let Some(_) = b.and_then(|p| p.parent()) { - () - } - }, -}; + +#[define_opaque(Bar)] +fn foo() -> A { + A { + func: |check, b| { + if check { + () + } else if let Some(_) = b.and_then(|p| p.parent()) { + () + } + }, + } +} fn main() {} |
