Guest User

Untitled

a guest
Mar 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. pub struct S(i32);
  2.  
  3. mod a {
  4. pub fn call_foo(s: &super::S) { s.foo(); }
  5.  
  6. mod b {
  7. fn some_method_private_to_b() {
  8. println!("inside some_method_private_to_b");
  9. }
  10.  
  11. impl super::super::S {
  12. pub(a) fn foo(&self) {
  13. some_method_private_to_b();
  14. println!("only callable within `a`: {}", self.0);
  15. }
  16. }
  17. }
  18. }
  19.  
  20. fn main() { }
Add Comment
Please, Sign In to add comment