mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
27 lines
486 B
Rust
27 lines
486 B
Rust
fn foo<T: Fn()>(t: T) {
|
|
t(1i32);
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
|
}
|
|
|
|
fn bar(t: impl Fn()) {
|
|
t(1i32);
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
|
}
|
|
|
|
fn baz() -> impl Fn() {
|
|
|| {}
|
|
}
|
|
|
|
fn baz2() {
|
|
baz()(1i32)
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
|
}
|
|
|
|
fn qux() {
|
|
let x = || {};
|
|
x(1i32);
|
|
//~^ ERROR function takes 0 arguments but 1 argument was supplied
|
|
}
|
|
|
|
fn main() {}
|