diff --git a/src/test/rustdoc/deref-typedef.rs b/src/test/rustdoc/deref-typedef.rs new file mode 100644 index 0000000000000..b2dc20a5030e7 --- /dev/null +++ b/src/test/rustdoc/deref-typedef.rs @@ -0,0 +1,19 @@ +#![crate_name = "foo"] + +// @has 'foo/struct.Bar.html' +// @has '-' '//*[@id="deref-methods"]' 'Methods from Deref' +// @has '-' '//*[@class="impl-items"]//*[@id="method.happy"]' 'pub fn happy(&self)' +// @has '-' '//*[@class="sidebar-title"]' 'Methods from Deref' +// @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!() } +}