rust/tests/ui/closures/2229_closure_analysis/issue_88118.rs
2024-02-16 20:02:50 +00:00

13 lines
280 B
Rust

// Regression test for #88118. Used to ICE.
//@ edition:2021
//@ check-pass
fn foo<MsU>(handler: impl FnOnce() -> MsU + Clone + 'static) {
Box::new(move |value| {
(|_| handler.clone()())(value);
None
}) as Box<dyn Fn(i32) -> Option<i32>>;
}
fn main() {}