/src/test/rustdoc/titles.rs

https://gitlab.com/jianglu/rust · Rust · 59 lines · 23 code · 14 blank · 22 comment · 0 complexity · 726c8ed2e297df92ced6b1aab63f3f93 MD5 · raw file

  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. #![crate_name = "foo"]
  11. // @matches 'foo/index.html' '//h1' 'Crate foo'
  12. // @matches 'foo/foo_mod/index.html' '//h1' 'Module foo::foo_mod'
  13. pub mod foo_mod {
  14. pub struct __Thing {}
  15. }
  16. extern {
  17. // @matches 'foo/fn.foo_ffn.html' '//h1' 'Function foo::foo_ffn'
  18. pub fn foo_ffn();
  19. }
  20. // @matches 'foo/fn.foo_fn.html' '//h1' 'Function foo::foo_fn'
  21. pub fn foo_fn() {}
  22. // @matches 'foo/trait.FooTrait.html' '//h1' 'Trait foo::FooTrait'
  23. pub trait FooTrait {}
  24. // @matches 'foo/struct.FooStruct.html' '//h1' 'Struct foo::FooStruct'
  25. pub struct FooStruct;
  26. // @matches 'foo/enum.FooEnum.html' '//h1' 'Enum foo::FooEnum'
  27. pub enum FooEnum {}
  28. // @matches 'foo/type.FooType.html' '//h1' 'Type Definition foo::FooType'
  29. pub type FooType = FooStruct;
  30. // @matches 'foo/macro.foo_macro.html' '//h1' 'Macro foo::foo_macro'
  31. #[macro_export]
  32. macro_rules! foo_macro {
  33. () => ();
  34. }
  35. // @matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool'
  36. #[doc(primitive = "bool")]
  37. mod bool {}
  38. // @matches 'foo/static.FOO_STATIC.html' '//h1' 'Static foo::FOO_STATIC'
  39. pub static FOO_STATIC: FooStruct = FooStruct;
  40. extern {
  41. // @matches 'foo/static.FOO_FSTATIC.html' '//h1' 'Static foo::FOO_FSTATIC'
  42. pub static FOO_FSTATIC: FooStruct;
  43. }
  44. // @matches 'foo/constant.FOO_CONSTANT.html' '//h1' 'Constant foo::FOO_CONSTANT'
  45. pub const FOO_CONSTANT: FooStruct = FooStruct;