Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s impossible (?) due to the “coherence” rule. A type A can implement a trait B in two places: the crate where A is defined or the crate where B is defined. So if you can see A and B, you know definitely whether A implements B.

The actual rule is more complex due to generics:

https://github.com/rust-lang/rfcs/blob/master/text/2451-re-r...

and that document doesn’t actually seem to think that this particular property is critical.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: