diff options
| author | bors <bors@rust-lang.org> | 2021-01-04 10:32:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-04 10:32:28 +0000 |
| commit | 6163bfdcce6404c5d61d6ab441bf49a831082194 (patch) | |
| tree | df84df6a3ff736da63f3c06a84595b7e310cffc4 /src/test | |
| parent | 887398ff688e2e3cf8a95e588d0b51420e08fb6b (diff) | |
| parent | 24ef94593c84084be03e6461b702178523767cf7 (diff) | |
Auto merge of #80661 - jyn514:duplicate-types, r=GuillaumeGomez
Cleanup rustdoc handling of associated types This is best reviewed a commit at a time. No particular reason for these changes, they just stood out as I was reviewing https://github.com/rust-lang/rust/pull/80653 and thinking about https://github.com/rust-lang/rust/issues/80379. The new test case worked before, it just wasn't tested. r? `@GuillaumeGomez`
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc/deref-typedef.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/test/rustdoc/deref-typedef.rs b/src/test/rustdoc/deref-typedef.rs index 770f8d7289c..e2dac2cf417 100644 --- a/src/test/rustdoc/deref-typedef.rs +++ b/src/test/rustdoc/deref-typedef.rs @@ -1,18 +1,27 @@ #![crate_name = "foo"] // @has 'foo/struct.Bar.html' -// @has '-' '//*[@id="deref-methods"]' 'Methods from Deref<Target = FooC>' +// @has '-' '//*[@id="deref-methods"]' 'Methods from Deref<Target = FooJ>' // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_a"]' 'pub fn foo_a(&self)' // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)' // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)' -// @has '-' '//*[@class="sidebar-title"]' 'Methods from Deref<Target=FooC>' +// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub fn foo_j(&self)' +// @has '-' '//*[@class="sidebar-title"]' 'Methods from Deref<Target=FooJ>' // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_a"]' 'foo_a' // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_b"]' 'foo_b' // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_c"]' 'foo_c' +// @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_j"]' 'foo_j' pub struct FooA; pub type FooB = FooA; pub type FooC = FooB; +pub type FooD = FooC; +pub type FooE = FooD; +pub type FooF = FooE; +pub type FooG = FooF; +pub type FooH = FooG; +pub type FooI = FooH; +pub type FooJ = FooI; impl FooA { pub fn foo_a(&self) {} @@ -26,8 +35,12 @@ impl FooC { pub fn foo_c(&self) {} } +impl FooJ { + pub fn foo_j(&self) {} +} + pub struct Bar; impl std::ops::Deref for Bar { - type Target = FooC; + type Target = FooJ; fn deref(&self) -> &Self::Target { unimplemented!() } } |
