rustdoc: handle generics better when matching notable traits
This commit makes the `clean::Type::is_same` non-commutative, so that a generic `impl` matches a concrete return, but a generic return does not match a concrete `impl`. It makes slice and vector Write for `u8` not match on every generic return value.
This commit is contained in:
parent
c6015851f7
commit
ee6b228b6a
5 changed files with 96 additions and 6 deletions
|
@ -18,3 +18,9 @@ pub fn bare_fn_matches() -> &'static [SomeStruct] {
|
|||
pub fn bare_fn_no_matches() -> &'static [OtherStruct] {
|
||||
&[]
|
||||
}
|
||||
|
||||
// @has doc_notable_trait_slice/fn.bare_fn_mut_no_matches.html
|
||||
// @count - '//script[@id="notable-traits-data"]' 0
|
||||
pub fn bare_fn_mut_no_matches() -> &'static mut [SomeStruct] {
|
||||
&mut []
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue