-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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.A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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
use std::fmt::Debug;
// Function that can not be called
fn xxx<A>(x:impl Debug){ println!("Done! {:?}", x) }
// Should an unused type parameter generate an error or warning?
fn yyy<A, B:Debug>(x:B){ println!("Done! {:?}", x) }
fn main(){
// xxx(123u8); //type annotations needed
// xxx::<()>(123u8); //too few type parameters provided: expected 2 type parameters, found 1 type parameter
// xxx::<(), _>(123u8); //cannot provide explicit type parameters when `impl Trait` is used in argument position.
// xxx::<(), u8>(123u8); //cannot provide explicit type parameters when `impl Trait` is used in argument position.
yyy::<(), u8>(123u8);
yyy::<(), _>(123u8);
}
hanna-kruppe, HMPerson1 and ChayimFriedman2Lymia
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.A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.