Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Backend {
- fn backend() {
- println!("I am a backend!");
- }
- }
- trait SupportsType<Other> {
- fn convert_type() {
- println!("I can convert this type!");
- }
- }
- mod A {
- use super::*;
- pub struct BackendA;
- impl Backend for BackendA {}
- impl SupportsType<BackendA> for *const str {}
- }
- mod B {
- use super::*;
- pub struct BackendB;
- impl Backend for BackendB {}
- impl SupportsType<BackendB> for *const str {}
- }
- impl<Back: Backend> SupportsType<Back> for *const str {}
- fn main() {
- }
Add Comment
Please, Sign In to add comment