]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/sidebar-items.rs
Rollup merge of #53559 - Dylan-DPC:fix/missing-doc-lint, r=kennytm
[rust.git] / src / test / rustdoc / sidebar-items.rs
1 // Copyright 2017 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 // @has foo/trait.Foo.html
14 // @has - '//*[@class="sidebar-title"][@href="#required-methods"]' 'Required Methods'
15 // @has - '//*[@class="sidebar-links"]/a' 'bar'
16 // @has - '//*[@class="sidebar-title"][@href="#provided-methods"]' 'Provided Methods'
17 // @has - '//*[@class="sidebar-links"]/a' 'foo'
18 // @has - '//*[@class="sidebar-title"][@href="#associated-const"]' 'Associated Constants'
19 // @has - '//*[@class="sidebar-links"]/a' 'BAR'
20 // @has - '//*[@class="sidebar-title"][@href="#associated-types"]' 'Associated Types'
21 // @has - '//*[@class="sidebar-links"]/a' 'Output'
22 pub trait Foo {
23     const BAR: u32 = 0;
24     type Output: ?Sized;
25
26     fn foo() {}
27     fn bar() -> Self::Output;
28 }
29
30 // @has foo/struct.Bar.html
31 // @has - '//*[@class="sidebar-title"][@href="#fields"]' 'Fields'
32 // @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f"]' 'f'
33 // @has - '//*[@class="sidebar-links"]/a[@href="#structfield.u"]' 'u'
34 // @!has - '//*[@class="sidebar-links"]/a' 'waza'
35 pub struct Bar {
36     pub f: u32,
37     pub u: u32,
38     waza: u32,
39 }
40
41 // @has foo/enum.En.html
42 // @has - '//*[@class="sidebar-title"][@href="#variants"]' 'Variants'
43 // @has - '//*[@class="sidebar-links"]/a' 'foo'
44 // @has - '//*[@class="sidebar-links"]/a' 'bar'
45 pub enum En {
46     foo,
47     bar,
48 }
49
50 // @has foo/union.MyUnion.html
51 // @has - '//*[@class="sidebar-title"][@href="#fields"]' 'Fields'
52 // @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f1"]' 'f1'
53 // @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f2"]' 'f2'
54 // @!has - '//*[@class="sidebar-links"]/a' 'waza'
55 pub union MyUnion {
56     pub f1: u32,
57     pub f2: f32,
58     waza: u32,
59 }