Add test for typedef deref
This commit is contained in:
parent
12f029b7ee
commit
fd4a88f309
19
src/test/rustdoc/deref-typedef.rs
Normal file
19
src/test/rustdoc/deref-typedef.rs
Normal file
@ -0,0 +1,19 @@
|
||||
#![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'
|
||||
pub struct FooA;
|
||||
pub type FooB = FooA;
|
||||
|
||||
impl FooA {
|
||||
pub fn happy(&self) {}
|
||||
}
|
||||
|
||||
pub struct Bar;
|
||||
impl std::ops::Deref for Bar {
|
||||
type Target = FooB;
|
||||
fn deref(&self) -> &FooB { unimplemented!() }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user