#![feature(negative_bounds)]
trait A {}
trait B {}
trait Common {}
impl<T> Common for T where T: A + !B {}
impl<T> Common for T where T: B + !A {}
fn main() {}
Playground
This piece of code fails to compile with error message: “conflicting implementations of trait Common
“
I intend for A and B to be mutually exclusive. I tried to use the negative_bounds
unstable feature to express this disjointedness, but it results in the same error. Is there a way to express this in Rust by any means, including unstable features?