Skip to content

Tracking Issue for RFC 3762, "Make trait methods callable in const contexts" #143874

Open
0 of 3 issues completed
@fee1-dead

Description

@fee1-dead

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

  • #[const_trait] attribute
  • impl const Trait
  • T: ~const Trait
  • append_const_msg on rustc_on_unimplemented
  • #[derive_const]
  • trait Destruct

Steps

  • Implement the RFC
  • Add const trait Trait and migrate away from #[const_trait]
  • 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_unstable attribute on const impls as they are now insta-stable.
    • Treat const trait default method bodies and const impl bodies as stable const fn bodies. We need to prevent accidentally stabilizing an implementation that uses unstable lang/lib const fn features.
    • Change Rustdoc to display [const] bounds or what syntax we decided it to be.

Unresolved Questions

Implementation history

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-trait-systemArea: Trait systemC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-const_trait_impl`#![feature(const_trait_impl)]`PG-const-traitsProject group: Const traitsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamWG-const-evalWorking group: Const evaluation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions