Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare const traits for stabilization #106

Open
5 of 14 tasks
nikomatsakis opened this issue Jul 22, 2024 · 8 comments
Open
5 of 14 tasks

Prepare const traits for stabilization #106

nikomatsakis opened this issue Jul 22, 2024 · 8 comments

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Jul 22, 2024

Metadata
Point of contact @oli-obk
Team(s) compiler, lang, types
Goal document 2025h1/const-trait

Summary

Prepare const Trait bounds for stabilization.

Tasks and status

Formalize const-traits in a-mir-formality

@nikomatsakis nikomatsakis added this to the 2024h2 milestone Jul 22, 2024
@rust-lang rust-lang locked and limited conversation to collaborators Jul 25, 2024
@nikomatsakis
Copy link
Contributor Author

This issue is intended for status updates only.

For general questions or comments, please contact the owner(s) directly.

@fee1-dead
Copy link
Member

fee1-dead commented Jul 27, 2024

Update 2024-07-27:

  • Key developments: We recently landed my new proposed desugaring in #120639, which is a big step towards having a robust model of const traits in the type system.

@fee1-dead
Copy link
Member

Update 2024-08-25:

@fee1-dead
Copy link
Member

Update 2024-10-02:

  • Key developments: With the PR for supporting implied super trait bounds landed (#129499), the current implementation is mostly complete in that it allows most code that should compile, and should reject all code that shouldn't. Further testing is required, with our next steps being improving diagnostics (#131152), and fixing more holes before we'd be comfortable with adding const traits back to core.

@fee1-dead
Copy link
Member

Update 2024-11-20:

#131985 by @compiler-errors completely restructured the way const traits are desugared, which made the design easier to understand and more robust against our current unit tests. Since then, there had been significant development and cleanup for the feature, with #131968 #132118 #132168 #132169 #132227 #132275 #132344 #132366 #132368 #132479 #132823 among the ones that got merged, and #133216 #133218 that are still open.

With the recent work, we are very close to being able to dogfooding the feature on the standard library again, and the current implementation is the closest we have towards something that can be stabilized.

@fee1-dead
Copy link
Member

Update 2024-12-30: (sorry for the delay!)

We began adding a small set of const traits and implementation in the compiler, while carefully looking for improvements in our implementation. We constified Add in rust-lang/rust#133237 and Deref/DerefMut in rust-lang/rust#133260.

A lot of the credits for implementing this feature goes to @compiler-errors, who authored these PRs (let me know if I have missed some): rust-lang/rust#133926 rust-lang/rust#134637 rust-lang/rust#134638

There was more progress on implementing stability for the const traits feature: rust-lang/rust#132823 (didn't include in the previous update, sorry), and rust-lang/rust#133999.

A couple of PRs constifying more traits are also open: rust-lang/rust#133995 rust-lang/rust#134628

@nikomatsakis nikomatsakis modified the milestones: 2024h2, 2025h1 Feb 18, 2025
@nikomatsakis
Copy link
Contributor Author

This is a continuing project goal, and the updates below this comment will be for the new period 2025h1

@nikomatsakis nikomatsakis assigned oli-obk and unassigned fee1-dead Feb 18, 2025
@nikomatsakis nikomatsakis moved this to Project goals in Lang team features Feb 21, 2025
@nikomatsakis nikomatsakis self-assigned this Feb 21, 2025
@nikomatsakis nikomatsakis changed the title Const traits Prepare const traits for stabilization Feb 26, 2025
@nikomatsakis nikomatsakis removed their assignment Feb 26, 2025
@nikomatsakis nikomatsakis moved this to Project goal in Lang team features Mar 4, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Mar 20, 2025

I opened an RFC (rust-lang/rfcs#3762) and we had a lang team meeting about it. Some design exploration and bikeshedding later we have settled on using (const)instead of ~const along with some more annotations for explicitness and some fewer annotations in other places. The RFC has been updated accordingly. There is still ongoing discussions about reintroducing the "fewer annotations" for redundancy and easier processing by humans.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Project goal
Development

No branches or pull requests

3 participants