/src/test/rustdoc/hidden-trait-struct-impls.rs

https://gitlab.com/jianglu/rust · Rust · 32 lines · 11 code · 7 blank · 14 comment · 4 complexity · 005944194885a4765fc1bbf6edfbeda8 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. #![crate_name = "foo"]
  11. #[doc(hidden)]
  12. pub trait Foo {}
  13. trait Dark {}
  14. pub trait Bam {}
  15. pub struct Bar;
  16. struct Hidden;
  17. // @!has foo/struct.Bar.html '//*[@id="impl-Foo"]' 'impl Foo for Bar'
  18. impl Foo for Bar {}
  19. // @!has foo/struct.Bar.html '//*[@id="impl-Dark"]' 'impl Dark for Bar'
  20. impl Dark for Bar {}
  21. // @has foo/struct.Bar.html '//*[@id="impl-Bam"]' 'impl Bam for Bar'
  22. // @has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Bar'
  23. impl Bam for Bar {}
  24. // @!has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Hidden'
  25. impl Bam for Hidden {}