]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/src-links.rs
Auto merge of #31700 - oli-obk:skip_double_ended, r=alexcrichton
[rust.git] / src / test / rustdoc / src-links.rs
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
11 #![crate_name = "foo"]
12
13 //! Dox
14 // @has src/foo/src-links.rs.html
15 // @has foo/index.html '//a/@href' '../src/foo/src-links.rs.html'
16
17 #[path = "src-links/mod.rs"]
18 pub mod qux;
19
20 // @has foo/bar/index.html '//a/@href' '../../src/foo/src-links.rs.html'
21 pub mod bar {
22
23     /// Dox
24     // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
25     pub mod baz {
26         /// Dox
27         // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
28         pub fn baz() { }
29     }
30
31     /// Dox
32     // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
33     pub trait Foobar { fn dummy(&self) { } }
34
35     // @has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/src-links.rs.html'
36     pub struct Foo { x: i32, y: u32 }
37
38     // @has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/src-links.rs.html'
39     pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { }
40 }
41
42 /// Dox
43 // @has foo/fn.modfn.html '//a/@href' '../src/foo/src-links.rs.html'
44 pub fn modfn() { }
45
46 // same hierarchy as above, but just for the submodule
47
48 // @has src/foo/src-links/mod.rs.html
49 // @has foo/qux/index.html '//a/@href' '../../src/foo/src-links/mod.rs.html'
50 // @has foo/qux/bar/index.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
51 // @has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
52 // @has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
53 // @has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
54 // @has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
55 // @has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
56 // @has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/src-links/mod.rs.html'