Skip to content

Shrink ParseSess#155896

Open
nnethercote wants to merge 2 commits intorust-lang:mainfrom
nnethercote:shrink-ParseSess
Open

Shrink ParseSess#155896
nnethercote wants to merge 2 commits intorust-lang:mainfrom
nnethercote:shrink-ParseSess

Conversation

@nnethercote
Copy link
Copy Markdown
Contributor

ParseSess contains some unnecessary fields. Details in individual commits.

r? @JonathanBrouwer

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 28, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to diagnostic attributes.

cc @mejrs

Some changes occurred in check-cfg diagnostics

cc @Urgau

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. labels Apr 28, 2026
Copy link
Copy Markdown
Contributor

@JonathanBrouwer JonathanBrouwer left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

📌 Commit 624fb95 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 28, 2026
@rust-bors

This comment has been minimized.

- This field is just a copy of `sess.unstable_opts.assume_incomplete_release`.
- This field has a single use.
- `sess` is also available at that use point

So this commit removes the field and gets the value directly from
`sess`.
`ParseSess` is separate from, but sits within, `Session`. The separation
is because there are some places (e.g. `Parser` methods) where
`ParseSess` is available but `Session` is not.

However, `ParseSess` has four fields that are only accessed from places
where `Session` is also available. This commit moves those fields to
`Session`. This means that `ParseSess` only contains the fields it
genuinely needs, and various `sess.psess.foo` occurrences are reduced to
`sess.foo`.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 28, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@nnethercote
Copy link
Copy Markdown
Contributor Author

I rebased.

@bors r=JonathanBrouwer

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

📌 Commit 01e933f has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 28, 2026
ShoyuVanilla added a commit to ShoyuVanilla/rust that referenced this pull request Apr 29, 2026
…nathanBrouwer

Shrink `ParseSess`

`ParseSess` contains some unnecessary fields. Details in individual commits.

r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
Rollup of 6 pull requests

Successful merges:

 - #152443 (NVPTX: Drop support for old architectures and old ISAs)
 - #155648 (`-Znext-solver` Propagate `stalled_on_coroutines` as a field in `Certainty::Maybe`)
 - #155896 (Shrink `ParseSess`)
 - #155922 (delete unused auxiliary test files)
 - #155943 (fix: ✏️ forgot to change the stable version for `assert_matches!` macro.)
 - #155947 (tests: mark simple UI tests as check-pass)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants