/src/test/rustdoc/inline_cross/assoc-items.rs

https://gitlab.com/jianglu/rust · Rust · 57 lines · 4 code · 5 blank · 48 comment · 0 complexity · fd893c6c8d19bff5ab15418891fa45af MD5 · raw file

  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. // aux-build:assoc-items.rs
  11. // build-aux-docs
  12. // ignore-cross-compile
  13. #![crate_name = "foo"]
  14. extern crate assoc_items;
  15. // @has foo/struct.MyStruct.html
  16. // @!has - 'PrivateConst'
  17. // @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8'
  18. // @has - '//*[@class="docblock"]' 'PublicConst: u8 = 123'
  19. // @has - '//*[@class="docblock"]' 'docs for PublicConst'
  20. // @!has - 'private_method'
  21. // @has - '//*[@id="method.public_method"]' 'pub fn public_method()'
  22. // @has - '//*[@class="docblock"]' 'docs for public_method'
  23. // @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
  24. // @has - '//*[@class="docblock"]' 'ConstNoDefault: i16 = -123'
  25. // @has - '//*[@class="docblock"]' 'dox for ConstNoDefault'
  26. // @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
  27. // @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345'
  28. // @has - '//*[@class="docblock"]' 'docs for ConstWithDefault'
  29. // @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32'
  30. // @has - '//*[@class="docblock"]' 'dox for TypeNoDefault'
  31. // @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32'
  32. // @has - '//*[@class="docblock"]' 'docs for TypeWithDefault'
  33. // @has - '//*[@id="method.method_no_default"]' 'fn method_no_default()'
  34. // @has - '//*[@class="docblock"]' 'dox for method_no_default'
  35. // @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()'
  36. // @has - '//*[@class="docblock"]' 'docs for method_with_default'
  37. pub use assoc_items::MyStruct;
  38. // @has foo/trait.MyTrait.html
  39. // @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
  40. // @has - '//*[@class="docblock"]' 'docs for ConstNoDefault'
  41. // @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
  42. // @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345'
  43. // @has - '//*[@class="docblock"]' 'docs for ConstWithDefault'
  44. // @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault'
  45. // @has - '//*[@class="docblock"]' 'docs for TypeNoDefault'
  46. // @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32'
  47. // @has - '//*[@class="docblock"]' 'docs for TypeWithDefault'
  48. // @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()'
  49. // @has - '//*[@class="docblock"]' 'docs for method_no_default'
  50. // @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()'
  51. // @has - '//*[@class="docblock"]' 'docs for method_with_default'
  52. pub use assoc_items::MyTrait;