Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. pub mod a {
  2. pub trait Tr {
  3. fn f(&self);
  4. }
  5. }
  6.  
  7. pub mod test1 {
  8. use super::a::Tr;
  9.  
  10. pub struct S;
  11.  
  12. impl Tr for S {
  13. fn f(&self) {
  14. println!("ok 1");
  15. }
  16. }
  17. }
  18.  
  19. pub mod test2 {
  20. pub struct S;
  21.  
  22. impl super::a::Tr for S {
  23. fn f(&self) {
  24. println!("ok 2");
  25. }
  26. }
  27. }
  28.  
  29. fn main() {
  30. use a::Tr;
  31.  
  32. test1::S.f();
  33. test2::S.f();
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement