]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/extern-default-method.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / rustdoc / extern-default-method.rs
1 // aux-build:rustdoc-extern-default-method.rs
2 // ignore-cross-compile
3 // ignore-tidy-linelength
4
5 extern crate rustdoc_extern_default_method as ext;
6
7 // For this test, the dependency is compiled but not documented.
8 //
9 // Still, the struct from the external crate and its impl should be documented since
10 // the struct is re-exported from this crate.
11 // However, the method in the trait impl should *not* have a link (an `href` attribute) to
12 // its corresponding item in the trait declaration since it would otherwise be broken.
13 //
14 // In older versions of rustdoc, the impl item (`a[@class="fn"]`) used to link to
15 // `#method.provided` – i.e. "to itself". Put in quotes since that was actually incorrect in
16 // general: If the type `Struct` also had an inherent method called `provided`, the impl item
17 // would link to that one even though those two methods are distinct items!
18
19 // @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]' 1
20 // @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="fn"]' 1
21 // @snapshot no_href_on_anchor - '//*[@id="method.provided"]//a[@class="fn"]'
22 // @has extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="anchor"]/@href' #method.provided
23 pub use ext::Struct;