]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/titles.rs
Rollup merge of #107412 - tshepang:needless-check, r=wesleywiser
[rust.git] / tests / rustdoc / titles.rs
1 #![crate_name = "foo"]
2 #![feature(rustdoc_internals)]
3
4 // @matches 'foo/index.html' '//h1' 'Crate foo'
5 // @matches 'foo/index.html' '//h2[@class="location"]' 'Crate foo'
6
7 // @matches 'foo/foo_mod/index.html' '//h1' 'Module foo::foo_mod'
8 // @matches 'foo/foo_mod/index.html' '//h2[@class="location"]' 'Module foo_mod'
9 pub mod foo_mod {
10     pub struct __Thing {}
11 }
12
13 extern "C" {
14     // @matches 'foo/fn.foo_ffn.html' '//h1' 'Function foo::foo_ffn'
15     pub fn foo_ffn();
16 }
17
18 // @matches 'foo/fn.foo_fn.html' '//h1' 'Function foo::foo_fn'
19 pub fn foo_fn() {}
20
21 // @matches 'foo/trait.FooTrait.html' '//h1' 'Trait foo::FooTrait'
22 // @matches 'foo/trait.FooTrait.html' '//h2[@class="location"]' 'FooTrait'
23 pub trait FooTrait {}
24
25 // @matches 'foo/struct.FooStruct.html' '//h1' 'Struct foo::FooStruct'
26 // @matches 'foo/struct.FooStruct.html' '//h2[@class="location"]' 'FooStruct'
27 pub struct FooStruct;
28
29 // @matches 'foo/enum.FooEnum.html' '//h1' 'Enum foo::FooEnum'
30 // @matches 'foo/enum.FooEnum.html' '//h2[@class="location"]' 'FooEnum'
31 pub enum FooEnum {}
32
33 // @matches 'foo/type.FooType.html' '//h1' 'Type Definition foo::FooType'
34 // @matches 'foo/type.FooType.html' '//h2[@class="location"]' 'FooType'
35 pub type FooType = FooStruct;
36
37 // @matches 'foo/macro.foo_macro.html' '//h1' 'Macro foo::foo_macro'
38 #[macro_export]
39 macro_rules! foo_macro {
40     () => {};
41 }
42
43 // @matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool'
44 #[doc(primitive = "bool")]
45 mod bool {}
46
47 // @matches 'foo/static.FOO_STATIC.html' '//h1' 'Static foo::FOO_STATIC'
48 pub static FOO_STATIC: FooStruct = FooStruct;
49
50 extern "C" {
51     // @matches 'foo/static.FOO_FSTATIC.html' '//h1' 'Static foo::FOO_FSTATIC'
52     pub static FOO_FSTATIC: FooStruct;
53 }
54
55 // @matches 'foo/constant.FOO_CONSTANT.html' '//h1' 'Constant foo::FOO_CONSTANT'
56 pub const FOO_CONSTANT: FooStruct = FooStruct;