-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
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
.
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
Labels
F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.