]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/non-tupled-call.rs
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / unboxed-closures / non-tupled-call.rs
1 #![feature(fn_traits, unboxed_closures, tuple_trait)]
2
3 use std::default::Default;
4 use std::marker::Tuple;
5
6 fn wrap<P: Tuple + Default, T>(func: impl Fn<P, Output = T>) {
7     let x: P = Default::default();
8     // Should be: `func.call(x);`
9     func(x);
10     //~^ ERROR cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit
11 }
12
13 fn foo() {}
14
15 fn main() {
16     wrap(foo);
17 }