/src/test/rustdoc/nested-modules.rs

https://gitlab.com/rust-lang/rust · Rust · 42 lines · 17 code · 9 blank · 16 comment · 0 complexity · a4b59b9ef6a059ce2afde1d064a992ce MD5 · raw file

  1. #![crate_name = "aCrate"]
  2. mod a_module {
  3. pub fn private_function() {}
  4. pub use a_module::private_function as other_private_function;
  5. pub mod a_nested_module {
  6. // @has aCrate/a_nested_module/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function'
  7. // @has aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
  8. pub fn a_nested_public_function() {}
  9. // @has aCrate/a_nested_module/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function'
  10. // @has aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
  11. pub use a_nested_module::a_nested_public_function as another_nested_public_function;
  12. }
  13. // @!has aCrate/a_nested_module/index.html 'yet_another_nested_public_function'
  14. pub use a_nested_module::a_nested_public_function as yet_another_nested_public_function;
  15. // @!has aCrate/a_nested_module/index.html 'one_last_nested_public_function'
  16. pub use a_nested_module::another_nested_public_function as one_last_nested_public_function;
  17. }
  18. // @!has aCrate/index.html 'a_module'
  19. // @has aCrate/index.html '//a[@href="a_nested_module/index.html"]' 'a_nested_module'
  20. pub use a_module::a_nested_module;
  21. // @has aCrate/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function'
  22. // @has aCrate/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function'
  23. // @has aCrate/index.html '//a[@href="fn.yet_another_nested_public_function.html"]' 'yet_another_nested_public_function'
  24. // @has aCrate/index.html '//a[@href="fn.one_last_nested_public_function.html"]' 'one_last_nested_public_function'
  25. pub use a_module::{
  26. a_nested_module::{a_nested_public_function, another_nested_public_function},
  27. one_last_nested_public_function, yet_another_nested_public_function,
  28. };
  29. // @has aCrate/index.html '//a[@href="fn.private_function.html"]' 'private_function'
  30. // @!has aCrate/fn.private_function.html 'a_module'
  31. // @has aCrate/index.html '//a[@href="fn.other_private_function.html"]' 'other_private_function'
  32. // @!has aCrate/fn.other_private_function.html 'a_module'
  33. pub use a_module::{other_private_function, private_function};