Guest User

Untitled

a guest
Apr 26th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. use std::fmt::Debug;
  2.  
  3. mod b {
  4. pub fn fun_b() {}
  5. }
  6.  
  7. mod a
  8. {
  9. use std::fmt::Debug;
  10. use b::fun_b;
  11.  
  12. trait A : Debug {}
  13.  
  14. fn fun_a() {
  15. fun_b();
  16. }
  17.  
  18. mod c
  19. {
  20. /* NOTE: SHOULD be here - dependency not transistive, not implicit */
  21. use b::fun_b;
  22. /* dependency should be declared explicitly, no "embedded" semantics */
  23. use a::fun_a;
  24.  
  25. pub fn fun_c() {
  26. fun_b();
  27. fun_a();
  28. }
  29. }
  30. /* mod in enclosing scope is also use for it */
  31. fn fun_g() {
  32. c::fun_c();
  33. }
  34. }
  35.  
  36. fn main() {
  37.  
  38. }
Add Comment
Please, Sign In to add comment