Closed
Description
Directly having an impl Trait for Trait
and cause a "coherence failed to report ambiguity" ICE. Having an indirect impl (impl<T: ?Sized> Trait for T
) causes cryptic "type annotations required: cannot resolve Bar : Bar
" and "recursion limit exceeded during monomorphisation" errors, but I didn't manage to get an ICE.
An example that causes a coherence failed to report ambiguity ICE:
trait Bar { fn bar(&self); }
impl Bar for Bar {
fn bar(&self) { println!("trait-object impl called"); }
}
impl Bar for () {
fn bar(&self) { println!("unit impl called"); }
}
fn main() {
}