2017-11-17 10:13:13 -06:00
|
|
|
// Test that unboxed closures cannot capture their own type.
|
|
|
|
//
|
|
|
|
// Also regression test for issue #21410.
|
|
|
|
|
2015-10-25 16:47:22 -05:00
|
|
|
fn g<F>(_: F) where F: FnOnce(Option<F>) {}
|
|
|
|
|
|
|
|
fn main() {
|
2017-11-20 06:13:27 -06:00
|
|
|
g(|_| { }); //~ ERROR closure/generator type that references itself
|
2015-10-25 16:47:22 -05:00
|
|
|
}
|