2017-11-17 11:13:13 -05:00
|
|
|
// Test that unboxed closures cannot capture their own type.
|
|
|
|
//
|
|
|
|
// Also regression test for issue #21410.
|
|
|
|
|
2015-10-25 17:47:22 -04:00
|
|
|
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
|
2015-10-25 17:47:22 -04:00
|
|
|
}
|