-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Description
This is a tracking issue for the RFC "3762" (rust-lang/rfcs#3762).
The feature gate for the issue is #![feature(const_trait_impl)].
Note
Questions about the usage of this feature should be directed to the t-compiler/project-const-traits Zulip channel. Use t-lang/effects and the RFC (until it gets accepted) to discuss the language feature and future extensions.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Components
Removed for good#[const_trait]attributeimpl const TraitT: [const] Traitappend_const_msgonrustc_on_unimplemented#[derive_const]trait Destruct
Steps
- Implement the RFC
- Add
const trait Traitand migrate away from#[const_trait]parseconst trait Trait#143879 - Split
derive_const,-> impl [const] Traitinto separate feature[s] to make initial stabilization minimal - add a perf stress test for const trait impls and complex bounds that need solving
- Adjust documentation (see instructions on rustc-dev-guide)
- Style updates for any new syntax (nightly-style-procedure)
- Style team decision on new formatting
- Formatting for new syntax has been added to the Style Guide
- (non-blocking) Formatting has been implemented in
rustfmt
- Stabilization PR (see instructions on rustc-dev-guide)
- Error against putting
rustc_const_unstableattribute onconstimpls as they are now insta-stable. - Treat
consttraitdefault method bodies andconstimplbodies asstableconst fnbodies. We need to prevent accidentally stabilizing an implementation that uses unstable lang/libconst fnfeatures. - Change Rustdoc to display
[const]bounds or what syntax we decided it to be.
- Error against putting
Unresolved Questions
-
#[derive_const]for custom derives (proc macros) Provide a way for derives to know if they were invoked with#[derive_const]#118304
Implementation history
- See Tracking issue for closed RFC 2632,
impl const Trait for Tyand[const](conditionally const) syntax (const_trait_impl) #67792 for previous tracking issue and its history - Incomplete list of PRs implementing/refining the feature: https://github.com/rust-lang/rust/pulls?q=is%3Apr+label%3AF-const_trait_impl+is%3Aclosed+