/src/test/rustdoc/src-links.rs

https://gitlab.com/rust-lang/rust · Rust · 46 lines · 12 code · 10 blank · 24 comment · 0 complexity · 30a45f03d934feb9394f484334f16d52 MD5 · raw file

  1. #![crate_name = "foo"]
  2. //! Dox
  3. // @has src/foo/src-links.rs.html
  4. // @has foo/index.html '//a/@href' '../src/foo/src-links.rs.html'
  5. #[path = "src-links/mod.rs"]
  6. pub mod qux;
  7. // @has foo/bar/index.html '//a/@href' '../../src/foo/src-links.rs.html'
  8. pub mod bar {
  9. /// Dox
  10. // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
  11. pub mod baz {
  12. /// Dox
  13. // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
  14. pub fn baz() { }
  15. }
  16. /// Dox
  17. // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
  18. pub trait Foobar { fn dummy(&self) { } }
  19. // @has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/src-links.rs.html'
  20. pub struct Foo { x: i32, y: u32 }
  21. // @has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/src-links.rs.html'
  22. pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { }
  23. }
  24. /// Dox
  25. // @has foo/fn.modfn.html '//a/@href' '../src/foo/src-links.rs.html'
  26. pub fn modfn() { }
  27. // same hierarchy as above, but just for the submodule
  28. // @has src/foo/src-links/mod.rs.html
  29. // @has foo/qux/index.html '//a/@href' '../../src/foo/src-links/mod.rs.html'
  30. // @has foo/qux/bar/index.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  31. // @has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
  32. // @has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
  33. // @has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  34. // @has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  35. // @has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  36. // @has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/src-links/mod.rs.html'