]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/titles.rs
Auto merge of #36293 - liigo:docblock-short, r=steveklabnik
[rust.git] / src / test / rustdoc / titles.rs
1 // Copyright 2016 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 // @matches 'foo/index.html' '//h1' 'Crate foo'
14
15 // @matches 'foo/foo_mod/index.html' '//h1' 'Module foo::foo_mod'
16 pub mod foo_mod {
17     pub struct __Thing {}
18 }
19
20 extern {
21     // @matches 'foo/fn.foo_ffn.html' '//h1' 'Function foo::foo_ffn'
22     pub fn foo_ffn();
23 }
24
25 // @matches 'foo/fn.foo_fn.html' '//h1' 'Function foo::foo_fn'
26 pub fn foo_fn() {}
27
28 // @matches 'foo/trait.FooTrait.html' '//h1' 'Trait foo::FooTrait'
29 pub trait FooTrait {}
30
31 // @matches 'foo/struct.FooStruct.html' '//h1' 'Struct foo::FooStruct'
32 pub struct FooStruct;
33
34 // @matches 'foo/enum.FooEnum.html' '//h1' 'Enum foo::FooEnum'
35 pub enum FooEnum {}
36
37 // @matches 'foo/type.FooType.html' '//h1' 'Type Definition foo::FooType'
38 pub type FooType = FooStruct;
39
40 // @matches 'foo/macro.foo_macro.html' '//h1' 'Macro foo::foo_macro'
41 #[macro_export]
42 macro_rules! foo_macro {
43     () => ();
44 }
45
46 // @matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool'
47 #[doc(primitive = "bool")]
48 mod bool {}
49
50 // @matches 'foo/static.FOO_STATIC.html' '//h1' 'Static foo::FOO_STATIC'
51 pub static FOO_STATIC: FooStruct = FooStruct;
52
53 extern {
54     // @matches 'foo/static.FOO_FSTATIC.html' '//h1' 'Static foo::FOO_FSTATIC'
55     pub static FOO_FSTATIC: FooStruct;
56 }
57
58 // @matches 'foo/constant.FOO_CONSTANT.html' '//h1' 'Constant foo::FOO_CONSTANT'
59 pub const FOO_CONSTANT: FooStruct = FooStruct;