// Regression test for . #![crate_name = "foo"] pub struct GenericStruct(T); impl GenericStruct { pub fn on_gen(arg: T) {} } impl GenericStruct { pub fn on_u32(arg: u32) {} } pub trait Foo {} pub trait Bar {} impl Foo for GenericStruct {} impl Bar for GenericStruct {} //@ has 'foo/type.TypedefStruct.html' // We check that "Aliased Type" is also present as a title in the sidebar. //@ has - '//*[@class="sidebar-elems"]//h3/a[@href="#aliased-type"]' 'Aliased Type' // We check that we have the implementation of the type alias itself. //@ has - '//*[@id="impl-GenericStruct%3Cu8%3E"]/h3' 'impl TypedefStruct' //@ has - '//*[@id="method.on_alias"]/h4' 'pub fn on_alias()' // This trait implementation doesn't match the type alias parameters so shouldn't appear in docs. //@ !has - '//h3' 'impl Bar for GenericStruct {}' // Same goes for the `Deref` impl. //@ !has - '//h2' 'Methods from Deref' //@ count - '//nav[@class="sidebar"]//a' 'on_alias' 1 //@ !has - '//nav[@class="sidebar"]//a' 'on_gen' //@ !has - '//nav[@class="sidebar"]//a' 'Foo' //@ !has - '//nav[@class="sidebar"]//a' 'Bar' //@ !has - '//nav[@class="sidebar"]//a' 'on_u32' // TypedefStruct inlined to GenericStruct //@ hasraw 'type.impl/foo/struct.GenericStruct.js' 'TypedefStruct' //@ hasraw 'type.impl/foo/struct.GenericStruct.js' 'method.on_gen' //@ hasraw 'type.impl/foo/struct.GenericStruct.js' 'Foo' pub type TypedefStruct = GenericStruct; impl TypedefStruct { pub fn on_alias() {} } impl std::ops::Deref for GenericStruct { type Target = u32; fn deref(&self) -> &Self::Target { &self.0 } } pub struct Wrap(GenericStruct); //@ has 'foo/type.Alias.html' //@ !has - '//h2' 'Methods from Deref' //@ !has - '//*[@id="impl-Deref-for-Wrap%3CT%3E"]/h3' 'impl Deref for Wrap' //@ hasraw 'type.impl/foo/struct.Wrap.js' 'impl-Deref-for-Wrap%3CT%3E' // Deref Methods aren't gathered for type aliases, though the actual impl is. //@ !hasraw 'type.impl/foo/struct.Wrap.js' 'BITS' pub type Alias = Wrap; impl std::ops::Deref for Wrap { type Target = GenericStruct; fn deref(&self) -> &Self::Target { &self.0 } }