-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
scottmcm
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.