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

https://gitlab.com/alx741/rust · Rust · 56 lines · 12 code · 11 blank · 33 comment · 0 complexity · 92bc0cfa74a46805ed0bd523f725b1fa MD5 · raw file

  1. // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
  2. // file at the top-level directory of this distribution and at
  3. // http://rust-lang.org/COPYRIGHT.
  4. //
  5. // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
  6. // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
  7. // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
  8. // option. This file may not be copied, modified, or distributed
  9. // except according to those terms.
  10. #![crate_name = "foo"]
  11. //! Dox
  12. // @has src/foo/src-links.rs.html
  13. // @has foo/index.html '//a/@href' '../src/foo/src-links.rs.html'
  14. #[path = "src-links/mod.rs"]
  15. pub mod qux;
  16. // @has foo/bar/index.html '//a/@href' '../../src/foo/src-links.rs.html'
  17. pub mod bar {
  18. /// Dox
  19. // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
  20. pub mod baz {
  21. /// Dox
  22. // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
  23. pub fn baz() { }
  24. }
  25. /// Dox
  26. // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
  27. pub trait Foobar { fn dummy(&self) { } }
  28. // @has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/src-links.rs.html'
  29. pub struct Foo { x: i32, y: u32 }
  30. // @has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/src-links.rs.html'
  31. pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { }
  32. }
  33. /// Dox
  34. // @has foo/fn.modfn.html '//a/@href' '../src/foo/src-links.rs.html'
  35. pub fn modfn() { }
  36. // same hierarchy as above, but just for the submodule
  37. // @has src/foo/src-links/mod.rs.html
  38. // @has foo/qux/index.html '//a/@href' '../../src/foo/src-links/mod.rs.html'
  39. // @has foo/qux/bar/index.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  40. // @has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
  41. // @has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
  42. // @has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  43. // @has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  44. // @has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
  45. // @has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/src-links/mod.rs.html'