Open
Description
This seems more like an error message issue than anything, but I was very confused for a while. Here is a repro:
#![feature(unboxed_closures)]
#![feature(default_type_params)]
pub trait Invoke<A, R = ()> {
fn invoke(&mut self, args: A) -> R;
}
impl<A, R, F: Send + FnMut(A) -> R> Invoke<A, R> for F {
fn invoke(&mut self, args: A) -> R {
self.call_mut((args,))
}
}
pub struct Foo;
impl Invoke<uint, uint> for Foo {
fn invoke(&mut self, args: uint) -> uint {
args
}
}
fn repro<A, I: Invoke<A>>(_: I) {
unimplemented!();
}
pub fn main() {
repro(Foo);
}
output:
repro.rs:28:5: 28:10 error: the trait `core::ops::Fn<(_,), ()>` is not implemented for the type `Foo`
repro.rs:28 repro(Foo);
^~~~~
repro.rs:28:5: 28:10 note: the trait `core::ops::Fn` must be implemented because it is required by `repro`
repro.rs:28 repro(Foo);
^~~~~
error: aborting due to previous error