1
Fork 0

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:
Michael Howell 2023-03-09 13:41:13 -07:00
parent c6015851f7
commit ee6b228b6a
5 changed files with 96 additions and 6 deletions

View file

@ -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 []
}