🛠️ specialization permits empty impls when parent has no default items (original) (raw)
It is potentially somewhat surprising that the following impls are accepted:
#![feature(specialization)]
trait Foo { fn bar(); }
impl 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