Skip to content

New const traits syntax #139858

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 15, 2025

This PR only affects the AST and doesn't actually change anything semantically.

All occurrences of ~const outside of libcore have been replaced by [const]. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts ~const into [const]. After this we can remove the ~const support from the parser

Caveat discovered during impl: there is no legacy bare trait object recovery for [const] Trait as that snippet in type position goes down the slice /array parsing code and will error

r? @fee1-dead

cc @nikomatsakis @traviscross @compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Apr 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 15, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from f6be056 to 2003458 Compare April 15, 2025 09:04
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from 2003458 to d6da247 Compare April 15, 2025 09:51
@rustbot

This comment was marked as outdated.

@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from d6da247 to e16c40b Compare April 15, 2025 12:38
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from 234ba91 to ef1acde Compare April 17, 2025 13:04
@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from ef1acde to 5fa25d4 Compare April 29, 2025 09:04
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from 5fa25d4 to 7762468 Compare April 29, 2025 09:55
@bors
Copy link
Collaborator

bors commented May 6, 2025

☔ The latest upstream changes (presumably #140695) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors
Copy link
Member

Have we actually settled on a syntax here? Sorry for punting it back over, but would like to get an update here if it's actually ready to review :> ping me when it's ready, sorry for the delays!

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 22, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@traviscross
Copy link
Contributor

Have we actually settled on a syntax here?

No. Discussion is ongoing.

@rustbot rustbot assigned fee1-dead and unassigned compiler-errors Jun 25, 2025
@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from d292dc6 to ae4dc9e Compare June 25, 2025 13:29
@oli-obk oli-obk added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 25, 2025
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from ae4dc9e to 2e751d2 Compare June 25, 2025 14:52
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from 2e751d2 to aca6032 Compare June 25, 2025 16:25
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from aca6032 to 06bc396 Compare June 26, 2025 08:51
@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 26, 2025

Afaict the syntax with which to move forward was settled as much as it could be in the last lang team design meeting. The lang team wants to get hands-on experience with the feature to see how it feels, so this PR is ready to be merged now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary for this PR; but would be nice if we renamed the "tilde-const" in the file names to either something syntax agnostic ("maybe-const") or matches the latest syntax

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in a follow-up commit

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 26, 2025
@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from dc95649 to c548946 Compare June 26, 2025 10:25
@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 26, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 26, 2025
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from c548946 to a9f1140 Compare June 26, 2025 10:45
@rustbot rustbot added the A-tidy Area: The tidy tool label Jun 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 26, 2025

There are changes to the tidy tool.

cc @jieyouxu

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jun 26, 2025
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from a9f1140 to 512ff95 Compare June 26, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants