Possibly spurious overlapping impl (even with specialization)
a6b8b13
Opened by Eira Fransham at
The following code leads to an "overlapping impl" error despite the fact that the bool impl is clearly more specific (totally concrete).
#![feature(specialization)]
trait Encodable {
fn encode() {}
}
trait Decodable {
fn decode() {}
}
impl Encodable for bool {
fn encode() {}
}
impl Decodable for bool {
fn decode() {}
}
impl<D> Encodable for D where for<'a> &'a D: AsRef<[u8]> {
default fn encode() {}
}
impl<T: for<'a> From<&'a [u8]>> Decodable for T {
default fn decode() {}
}
Now that I think about it, this is probably because
boolandAsRefare defined in the same crate and therefore conceivablyAsRef<[u8]>could be implemented forboolwithout it being considered a breaking change.Eira Fransham at 2017-07-07 09:06:06
triage: no change
Maayan Hanin at 2022-10-17 10:16:34