rust/tests/ui/unboxed-closures/non-tupled-call.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
414 B
Rust
Raw Normal View History

2022-12-20 18:30:12 +00:00
#![feature(fn_traits, unboxed_closures, tuple_trait)]
use std::default::Default;
use std::marker::Tuple;
fn wrap<P: Tuple + Default, T>(func: impl Fn<P, Output = T>) {
let x: P = Default::default();
// Should be: `func.call(x);`
func(x);
//~^ ERROR cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit
}
fn foo() {}
fn main() {
wrap(foo);
}