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

- 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

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
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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants