2022-07-10 16:59:31 -05:00
|
|
|
fn foo<T: Fn()>(t: T) {
|
|
|
|
t(1i32);
|
2023-01-04 21:02:10 -06:00
|
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
2022-07-10 16:59:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bar(t: impl Fn()) {
|
|
|
|
t(1i32);
|
2023-01-04 21:02:10 -06:00
|
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
2022-07-10 16:59:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn baz() -> impl Fn() {
|
|
|
|
|| {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn baz2() {
|
|
|
|
baz()(1i32)
|
2023-01-04 21:02:10 -06:00
|
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
2022-07-10 16:59:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn qux() {
|
|
|
|
let x = || {};
|
|
|
|
x(1i32);
|
2023-01-04 21:02:10 -06:00
|
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
2022-07-10 16:59:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|