[rustdoc] Remove special-case preventing Destruct trait to be displayed in generic bounds#151515
[rustdoc] Remove special-case preventing Destruct trait to be displayed in generic bounds#151515GuillaumeGomez wants to merge 1 commit intorust-lang:mainfrom
Destruct trait to be displayed in generic bounds#151515Conversation
…ayed in generic bounds
|
|
|
I think that's the result of some refactoring; this was introduced in #92229, so cc @fee1-dead |
| @@ -226,13 +226,6 @@ fn clean_generic_bound<'tcx>( | |||
| Some(match bound { | |||
| hir::GenericBound::Outlives(lt) => GenericBound::Outlives(clean_lifetime(lt, cx)), | |||
| hir::GenericBound::Trait(t) => { | |||
There was a problem hiding this comment.
The point still stands though: T: Destruct is meaningless and only [const] Destruct and const Destruct are meaningful but we intentionally don't render const trait bound modifiers in rustdoc for now to avoid confusing readers of libstd docs on stable.
Therefore, with my PG-const-traits hat on, I don't agree with this change. The real (temporary) fix would be to drop empty HIR where-clauses (following the [const] Destruct removal).
Moreover, under the current version of your PR, you start rendering T: Destruct (no-op bound) in the local case (e.g., core::mem::drop) but not in the inlined cross-crate re-export case (e.g., std::mem::drop).
Side note: I'm of the opinion that we should actually render const trait bound modifiers by default for a given crate (that enables CTI) and introduce an internal attribute for core & std to suppress them. See also this Zulip discussion.
Fixes #151502.
Since you're the one who added this code (I think, based on what I found with
git blame), I'll set you as reviewer @oli-obk.r? @oli-obk