Closed
Description
The below example fails to compile with error "not all trait items implemented, missing: trait_1".
Swapping modules one
and two
causes the code to compile correctly.
The same issue happens when one
and two
are defined in external files.
Version: rustc 1.27.0-nightly (e82261d 2018-05-03)
#![feature(specialization)]
mod two {
use one::{Foo, Trait};
impl Trait for Foo<i32> {
fn trait_2(&self) {}
}
impl Trait for Foo<i64> { // not all trait items implemented, missing: `trait_1`
fn trait_2(&self) {}
}
}
mod one {
pub struct Foo<A> { data: A }
pub trait Trait {
fn trait_1(&self);
fn trait_2(&self);
}
impl<A> Trait for Foo<A> {
fn trait_1(&self) {}
default fn trait_2(&self) {}
}
}
fn main() {
}