Hacker News new | ask | show | jobs
by kaoD 2924 days ago
Actually you can do that:

http://play.rust-lang.org/?gist=566c7ddb5ec90836004a2549aa78...

Because `impl Add<Bar>` and `impl Add<Baz>` are two clearly different impls there is no ambiguity (RHS is known at compile time).

What specialization would solve is this kind of ambiguity:

http://play.rust-lang.org/?gist=34142671953f75f0448b03bb804f...

Because `impl<T: Debug> Add<T>` and `impl Add<Baz>` are conflicting, since Baz is `:Debug` so both impls apply for a Baz RHS.