diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-14 20:40:47 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-14 20:40:59 -0400 |
| commit | 8994840f7e61c1e90db35e7d966d0271880d905c (patch) | |
| tree | 3b15c94dd4fe273ece3d1866ef557d3bcd7f18fa /src/librustdoc/html/render | |
| parent | 8387315ab3c26a57a1f53a90f188f0bc88514bca (diff) | |
rustdoc: Negative impls are not notable
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index b4e62e39d8d..18323e0b8ad 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1424,6 +1424,10 @@ pub(crate) fn notable_traits_button(ty: &clean::Type, cx: &mut Context<'_>) -> O if let Some(impls) = cx.cache().impls.get(&did) { for i in impls { let impl_ = i.inner_impl(); + if impl_.polarity != ty::ImplPolarity::Positive { + continue; + } + if !ty.is_doc_subtype_of(&impl_.for_, cx.cache()) { // Two different types might have the same did, // without actually being the same. @@ -1459,6 +1463,10 @@ fn notable_traits_decl(ty: &clean::Type, cx: &Context<'_>) -> (String, String) { for i in impls { let impl_ = i.inner_impl(); + if impl_.polarity != ty::ImplPolarity::Positive { + continue; + } + if !ty.is_doc_subtype_of(&impl_.for_, cx.cache()) { // Two different types might have the same did, // without actually being the same. |
