mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
Re-enable fn trait call notation error
This commit is contained in:
parent
65bd2a6a73
commit
738b0c0673
@ -214,7 +214,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
"cannot use call notation; the first type parameter \
|
||||
for the function trait is neither a tuple nor unit"
|
||||
)
|
||||
.delay_as_bug();
|
||||
.emit();
|
||||
(self.err_args(provided_args.len()), None)
|
||||
}
|
||||
}
|
||||
|
17
src/test/ui/unboxed-closures/non-tupled-call.rs
Normal file
17
src/test/ui/unboxed-closures/non-tupled-call.rs
Normal file
@ -0,0 +1,17 @@
|
||||
#![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);
|
||||
}
|
9
src/test/ui/unboxed-closures/non-tupled-call.stderr
Normal file
9
src/test/ui/unboxed-closures/non-tupled-call.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0059]: cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit
|
||||
--> $DIR/non-tupled-call.rs:9:5
|
||||
|
|
||||
LL | func(x);
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0059`.
|
Loading…
Reference in New Issue
Block a user