Skip to content

Incorrect docs generated for derive_const traits #107119

Open
@Expyron

Description

@Expyron

This is currently in beta; not yet in stable.

The beta docs (here) show that the PartialEq and PartialOrd implementations of std::cmp::Ordering are const.

derive_const

Same for TypeId (only in nightly for now).

Both use derive_const to generate the trait implementations.
Const traits do not work outside nigthly, and only with feature const_trait_impl enabled, so they should not be marked as such in the documentation.

Trying to use these methods in a const context gives an error, as intended:
https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=bba4e8edb1baa3743739b3cb207e6892

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-const_trait_impl`#![feature(const_trait_impl)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions