> there's no way to declare that it does without changing the third-party 
>library's code

This is true in classical sealed classes, but not in open typeclasses.
You can always declare an implementation of an interface for a
3rd-party datatype in your own module, or in the module that declares
the interface.

If there really is no connection between the interface and the methods
that a module happens to implement, the chance that they will
coincidentally match and implement the same protocol is very small
anyway. A wrapper/adapter impl is extremely trivial to write.

I'm still skeptical about monomorphizing all bounded generics. Might
work out, but it'll require an overhaul of the compiler and some
extensive measurement (for unintended bloat). The first version of
this should probably do vtable-passing.

Best,
Marijn
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to