Open
Description
STR
Example from libcore:
#![crate_type = "lib"]
#![feature(associated_types)]
#![no_implicit_prelude]
trait Iterator {
type Item;
}
trait AdditiveIterator {
type Sum;
fn sum(self) -> Self::Sum;
}
impl<I> AdditiveIterator for I where I: Iterator<Item=u8> { //~error conflicting implementation
type Sum = u8;
fn sum(self) -> u8 { loop {} }
}
impl<I> AdditiveIterator for I where I: Iterator<Item=u16> { //~note conflicting implementation here
type Sum = u16;
fn sum(self) -> u16 { loop {} }
}
Version
No type can implement both Iterator<Item=u8>
and Iterator<Item=u16>
, therefore these blanket impls are non overlapping and should be accepted.