Open
Description
It is potentially somewhat surprising that the following impls are accepted:
#![feature(specialization)]
trait Foo {
fn bar();
}
impl<T> Foo for T {
fn bar() { } // no default
}
impl Foo for i32 {
// OK so long as we define no items:
// fn bar() { }
}
fn main() {}
The original example was unearthed by @eddyb and @varkor as part of a PR.
To be clear, I don't see this as a soundness problem per se. Just a question of what we think it ought to do.
cc @aturon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: Trait impl specializationArea: Trait systemCategory: An issue proposing an enhancement or a PR with one.`#![feature(specialization)]`Status: Identified as a valid potential future enhancement that is not currently being worked onRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.