Skip to content

Commit

Permalink
rustdoc changes for ~const Drop
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Apr 5, 2022
1 parent b744bb6 commit 9f70a7b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,14 @@ impl Clean<Option<GenericBound>> for hir::GenericBound<'_> {
)
}
hir::GenericBound::Trait(ref t, modifier) => {
// `T: ~const Drop` is not equivalent to `T: Drop`, and we don't currently document `~const` bounds
// because of its experimental status, so just don't show these.
// `T: ~const Destruct` is hidden because `T: Destruct` is a no-op.
if modifier == hir::TraitBoundModifier::MaybeConst
&& [cx.tcx.lang_items().drop_trait(), cx.tcx.lang_items().destruct_trait()]
.iter()
.any(|tr| *tr == Some(t.trait_ref.trait_def_id().unwrap()))
&& cx.tcx.lang_items().destruct_trait()
== Some(t.trait_ref.trait_def_id().unwrap())
{
return None;
}

#[cfg(bootstrap)]
{
// FIXME: remove `lang_items().drop_trait()` from above logic,
// as well as the comment about `~const Drop` because it was renamed to `Destruct`.
}
GenericBound::TraitBound(t.clean(cx), modifier)
}
})
Expand Down

0 comments on commit 9f70a7b

Please sign in to comment.