mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
18 lines
414 B
Rust
18 lines
414 B
Rust
#![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);
|
|
}
|