rust/tests/ui/closures/2229_closure_analysis/issue_88118.rs

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

16 lines
334 B
Rust
Raw Normal View History

// Regression test for #88118. Used to ICE.
//
// check-pass
2021-08-23 17:25:55 -05:00
#![allow(incomplete_features)]
#![feature(capture_disjoint_fields)]
fn foo<MsU>(handler: impl FnOnce() -> MsU + Clone + 'static) {
Box::new(move |value| {
(|_| handler.clone()())(value);
None
}) as Box<dyn Fn(i32) -> Option<i32>>;
}
2021-08-23 14:53:18 -05:00
fn main() {}