]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc/extern-default-method.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / rustdoc / extern-default-method.rs
CommitLineData
9346a6ac 1// aux-build:rustdoc-extern-default-method.rs
d9579d0f 2// ignore-cross-compile
04454e1e 3// ignore-tidy-linelength
85aaf69f 4
9346a6ac
AL
5extern crate rustdoc_extern_default_method as ext;
6
04454e1e
FG
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="fnname"]`) 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
9346a6ac 19// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]' 1
04454e1e
FG
20// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="fnname"]' 1
21// @snapshot no_href_on_anchor - '//*[@id="method.provided"]//a[@class="fnname"]'
5099ac24 22// @has extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="anchor"]/@href' #method.provided
c34b1796 23pub use ext::Struct;