SHARE
TWEET

Untitled

a guest Jun 15th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top