about summary refs log tree commit diff
path: root/tests/ui/traits/dont-suggest-impl-as-closure-arg.rs
blob: 68e234b0f20d314e522514634aff71a8c560749b (plain)
1
2
3
4
5
// Suggestion to use impl trait in closure parameter is invalid, see issue 138932
fn main() {
    let c = |f: dyn Fn()| f();
    //~^ ERROR: the size for values of type `(dyn Fn() + 'static)` cannot be known at compilation time
}