]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closure-no-cyclic-sig.rs
Rollup merge of #87440 - twetzel59:fix-barrier-no-op, r=yaahc
[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 }