Skip to content

Semantic check of mut restrictions - #159906

Merged
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
CoCo-Japan-pan:mut-restriction-check
Aug 2, 2026
Merged

rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
CoCo-Japan-pan:mut-restriction-check

Conversation

@CoCo-Japan-pan

@CoCo-Japan-pan CoCo-Japan-pan commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

This PR implements semantic checks for mut restrictions proposed in RFC 3323, as part of the related GSoC project.
It lowers field restriction information from HIR into rustc_middle::ty::FieldDef and adds a MIR-level lint that rejects restricted field mutations and struct expressions. As parsing (#156824) and path resolution (#159125) have already been implemented, this PR provides a working implementation of mut restrictions.

Tracking issue: #105077
r? @Urgau
cc @jhpratt

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

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants