Closed
Description
In some cases it seems like you are able to use the turbofish syntax with impl Trait
use std::any::Any;
pub struct EventHandler {
}
impl EventHandler
{
pub fn handle_event<T: Any>(&mut self, _efunc: impl FnMut(T)) {}
}
struct TestEvent(i32);
fn main() {
let mut evt = EventHandler {};
evt.handle_event::<TestEvent, fn(TestEvent)>(|_evt| {
});
}
playground: http://play.rust-lang.org/?gist=62b8c9d317dd6f149354555ca42d45b3&version=stable&mode=debug
This should fail with error[E0632]: cannot provide explicit type parameters when `impl Trait` is used in argument position.