]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closure-no-cyclic-sig.rs
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / unboxed-closures / unboxed-closure-no-cyclic-sig.rs
1 // Test that unboxed closures cannot capture their own type.
2 //
3 // Also regression test for issue #21410.
4
5 fn g<F>(_: F) where F: FnOnce(Option<F>) {}
6
7 fn main() {
8     g(|_| {  }); //~ ERROR closure/generator type that references itself
9 }