Skip to content

[const] Destruct bounds aren't rendered #151502

@clubby789

Description

@clubby789

Tracking issue: #133214

[const] Destruct bounds are rendered as an empty bounds list, which is exposed by some const std functions.

Image

This is not the case for other [const] trait bounds:

#![feature(const_trait_impl)]

pub const trait Foo {}

pub const fn f<T>(_: &T)
where T: [const] Foo {} 
Image

While this is a deliberate choice

// `T: [const] Destruct` is hidden because `T: Destruct` is a no-op.
if let hir::BoundConstness::Maybe(_) = t.modifiers.constness
&& cx.tcx.lang_items().destruct_trait() == Some(t.trait_ref.trait_def_id().unwrap())
{
return None;
}

I think this results in a confusing render, and that it would be better to display it or omit the where T: entirely here

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions