rust/tests/ui/closures/2229_closure_analysis/issue_88118.rs
2023-02-28 01:21:15 +00:00

13 lines
278 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() {}