Skip to content

Mut restriction parse#156824

Open
CoCo-Japan-pan wants to merge 9 commits into
rust-lang:mainfrom
CoCo-Japan-pan:mut-restriction-parse
Open

Mut restriction parse#156824
CoCo-Japan-pan wants to merge 9 commits into
rust-lang:mainfrom
CoCo-Japan-pan:mut-restriction-parse

Conversation

@CoCo-Japan-pan
Copy link
Copy Markdown
Contributor

@CoCo-Japan-pan CoCo-Japan-pan commented May 22, 2026

This PR is part of the progress implementing mut restrictions proposed in RFC 3323, and linked to a GSoC proposal.
This PR focuses solely on the parsing of mut restrictions.
The keyword order is pub(...) mut(...) unsafe field.
The new syntax is guared by #[feature(mut_restriction)] feature gate.
Tracking Issue: #105077

r? @Urgau
cc @jhpratt

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 22, 2026

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

Changes to the size of AST and/or HIR nodes.

cc @nnethercote

The Rustfmt subtree was changed

cc @rust-lang/rustfmt

The Clippy subtree was changed

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels May 22, 2026
Copy link
Copy Markdown
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me, I only have a single nit.

View changes since this review

Comment thread compiler/rustc_parse/src/parser/mod.rs Outdated
@CoCo-Japan-pan CoCo-Japan-pan force-pushed the mut-restriction-parse branch from fe707fe to a594594 Compare May 23, 2026 03:30
Copy link
Copy Markdown
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

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

LGTM, I will let @jhpratt do a final review.

View changes since this review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants