rust/tests/ui/unboxed-closures/unboxed-closure-no-cyclic-sig.rs

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

10 lines
239 B
Rust
Raw Normal View History

// Test that unboxed closures cannot capture their own type.
//
// Also regression test for issue #21410.
fn g<F>(_: F) where F: FnOnce(Option<F>) {}
fn main() {
2023-10-19 21:46:28 +00:00
g(|_| { }); //~ ERROR closure/coroutine type that references itself
}