-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rendering on sidebar and update tests
- Loading branch information
1 parent
d755238
commit 8a9b951
Showing
2 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,33 @@ | ||
#![crate_name = "foo"] | ||
|
||
// @has 'foo/struct.Bar.html' | ||
// @has '-' '//*[@id="deref-methods"]' 'Methods from Deref<Target = FooB>' | ||
// @has '-' '//*[@class="impl-items"]//*[@id="method.happy"]' 'pub fn happy(&self)' | ||
// @has '-' '//*[@class="sidebar-title"]' 'Methods from Deref<Target=FooB>' | ||
// @has '-' '//*[@class="sidebar-links"]/a[@href="#method.happy"]' 'happy' | ||
// @has '-' '//*[@id="deref-methods"]' 'Methods from Deref<Target = FooC>' | ||
// @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="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' | ||
|
||
pub struct FooA; | ||
pub type FooB = FooA; | ||
pub type FooC = FooB; | ||
|
||
impl FooA { | ||
pub fn happy(&self) {} | ||
pub fn foo_a(&self) {} | ||
} | ||
|
||
impl FooB { | ||
pub fn foo_b(&self) {} | ||
} | ||
|
||
impl FooC { | ||
pub fn foo_c(&self) {} | ||
} | ||
|
||
pub struct Bar; | ||
impl std::ops::Deref for Bar { | ||
type Target = FooB; | ||
fn deref(&self) -> &FooB { unimplemented!() } | ||
type Target = FooC; | ||
fn deref(&self) -> &Self::Target { unimplemented!() } | ||
} |