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
7d4f487
No type can implement both Iterator<Item=u8> and Iterator<Item=u16>, therefore these blanket impls are non overlapping and should be accepted.
cc @nikomatsakis
STR
Example from libcore:
Version
7d4f487
No type can implement both
Iterator<Item=u8>andIterator<Item=u16>, therefore these blanket impls are non overlapping and should be accepted.cc @nikomatsakis