about summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
diff options
context:
space:
mode:
authorDavid Wood <david.wood2@arm.com>2025-03-02 23:36:00 +0000
committerDavid Wood <david.wood2@arm.com>2025-06-16 23:04:36 +0000
commit2f8e7600314f902fdb3daccda1ab9b44b4e9e95e (patch)
treea7a97a2658725ba428d78edf4dc492e5774f7b3b /src/librustdoc/clean/inline.rs
parentd531a84e51e116f7b193d2624037b936987ced07 (diff)
downloadrust-2f8e7600314f902fdb3daccda1ab9b44b4e9e95e.tar.gz
rust-2f8e7600314f902fdb3daccda1ab9b44b4e9e95e.zip
rustdoc: skip `MetaSized` bounds
These should never be shown to users at the moment.
Diffstat (limited to 'src/librustdoc/clean/inline.rs')
-rw-r--r--src/librustdoc/clean/inline.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index 9b5491310b4..dcd499d5f0d 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -265,13 +265,27 @@ pub(crate) fn build_trait(cx: &mut DocContext<'_>, did: DefId) -> clean::Trait {
         .collect();
 
     let generics = clean_ty_generics(cx, did);
-    let (generics, supertrait_bounds) = separate_self_bounds(generics);
+    let (generics, mut supertrait_bounds) = separate_self_bounds(generics);
+
+    supertrait_bounds.retain(|b| {
+        // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized`
+        // is shown and none of the new sizedness traits leak into documentation.
+        !b.is_meta_sized_bound(cx)
+    });
+
     clean::Trait { def_id: did, generics, items: trait_items, bounds: supertrait_bounds }
 }
 
 fn build_trait_alias(cx: &mut DocContext<'_>, did: DefId) -> clean::TraitAlias {
     let generics = clean_ty_generics(cx, did);
-    let (generics, bounds) = separate_self_bounds(generics);
+    let (generics, mut bounds) = separate_self_bounds(generics);
+
+    bounds.retain(|b| {
+        // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized`
+        // is shown and none of the new sizedness traits leak into documentation.
+        !b.is_meta_sized_bound(cx)
+    });
+
     clean::TraitAlias { generics, bounds }
 }