Skip to content

More AST lowering cleanups - #162950

Merged
rust-bors[bot] merged 7 commits into
rust-lang:mainfrom
nnethercote:more-lowering-cleanups
Sep 19, 2026
Merged

rust-bors[bot] merged 7 commits into
rust-lang:mainfrom
nnethercote:more-lowering-cleanups

Conversation

@nnethercote

Copy link
Copy Markdown
Contributor

Details in individual commits.

r? @spastorino

`into_owner_info` arena-allocates the created `OwnerInfo`.
`ItemLowerer::with_lctx` calls `into_owner_info` and then
re-arena-allocates the returned `OwnerInfo` (the reference, not the
entire struct). This commit removes the latter.
As `LoweringContext::current_item_span`, because it *is* a span.
It's trivial and has a single call site.
It's just a thin wrapper around `tcx` and `resolver`. The `lower_*`
methods all have a single call site and can be inlined, and `with_lctx`
can just be a local fn within `lower_to_hir`.

This requires increasing the visibility of some
`LoweringContext::lower_*` methods that are now called outside of
`item.rs`.
@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. labels Sep 18, 2026
@nnethercote

Copy link
Copy Markdown
Contributor Author

LLM disclosure: Some of these changes were identified by an LLM. I made all the code and text changes myself.

@spastorino

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 11b373e has been approved by spastorino

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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 18, 2026
…, r=spastorino

More AST lowering cleanups

Details in individual commits.

r? @spastorino
rust-bors Bot pushed a commit that referenced this pull request Sep 18, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #160859 (`core::num::f16b` Rust's 16bit Brain Float)
 - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
 - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area)
 - #162733 (Add useful APIs to `Unique(Arc|Rc)`)
 - #162950 (More AST lowering cleanups)
 - #162964 (Update `browser-ui-test` version to `0.25.2`)
 - #162797 (yeet AliasConstKind::opt_def_id)
 - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports)
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 19, 2026
…, r=spastorino

More AST lowering cleanups

Details in individual commits.

r? @spastorino
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
Rollup of 18 pull requests

Successful merges:

 - #162499 (`rustc_codegen_gcc` subtree update)
 - #161424 (implement `VaArgSafe` for `f128`)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162506 (Avoid suggesting imports of traits declared inside fn bodies)
 - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area)
 - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names)
 - #162733 (Add useful APIs to `Unique(Arc|Rc)`)
 - #162913 (Refactor LivenessResults into LivenessComputation, without typeck)
 - #162950 (More AST lowering cleanups)
 - #162964 (Update `browser-ui-test` version to `0.25.2`)
 - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`)
 - #161743 (Add performance notes for the floating-point round method)
 - #162797 (yeet AliasConstKind::opt_def_id)
 - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports)
 - #162873 (Adjust `bug!`/`span_bug!` emission)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests)
 - #162981 (rustc-dev-guide subtree update)

Failed merges:

 - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
Rollup of 18 pull requests

Successful merges:

 - #162499 (`rustc_codegen_gcc` subtree update)
 - #161424 (implement `VaArgSafe` for `f128`)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162506 (Avoid suggesting imports of traits declared inside fn bodies)
 - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area)
 - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names)
 - #162733 (Add useful APIs to `Unique(Arc|Rc)`)
 - #162913 (Refactor LivenessResults into LivenessComputation, without typeck)
 - #162950 (More AST lowering cleanups)
 - #162964 (Update `browser-ui-test` version to `0.25.2`)
 - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`)
 - #161743 (Add performance notes for the floating-point round method)
 - #162797 (yeet AliasConstKind::opt_def_id)
 - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports)
 - #162873 (Adjust `bug!`/`span_bug!` emission)
 - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt)
 - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests)
 - #162981 (rustc-dev-guide subtree update)

Failed merges:

 - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 19, 2026
…, r=spastorino

More AST lowering cleanups

Details in individual commits.

r? @spastorino
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #163001 (Temporarily disable `test-x86_64-fuchsia`)
 - #162880 (Mini optimization in `rustc_hir_typeck::upvar::restrict_precision_for_drop_types`)
 - #161424 (implement `VaArgSafe` for `f128`)
 - #161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - #162506 (Avoid suggesting imports of traits declared inside fn bodies)
 - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area)
 - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names)
 - #162733 (Add useful APIs to `Unique(Arc|Rc)`)
 - #162913 (Refactor LivenessResults into LivenessComputation, without typeck)
 - #162924 (Remove applying inline attributes at the callsite)
 - #162940 (Use spawned `SBDebugger` instance)
 - #162950 (More AST lowering cleanups)
 - #162964 (Update `browser-ui-test` version to `0.25.2`)
 - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`)
 - #161743 (Add performance notes for the floating-point round method)
 - #162797 (yeet AliasConstKind::opt_def_id)
 - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports)
 - #162873 (Adjust `bug!`/`span_bug!` emission)
 - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests)
 - #162971 (libtest harness: avoid 'extern crate test' with custom runner)
 - #162981 (rustc-dev-guide subtree update)
 - #162985 (Error on invalid placements for unstable attributes)
@rust-bors
rust-bors Bot merged commit bda9eaf into rust-lang:main Sep 19, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 19, 2026
Rollup merge of #162950 - nnethercote:more-lowering-cleanups, r=spastorino

More AST lowering cleanups

Details in individual commits.

r? @spastorino
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Sep 20, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#163001 (Temporarily disable `test-x86_64-fuchsia`)
 - rust-lang/rust#162880 (Mini optimization in `rustc_hir_typeck::upvar::restrict_precision_for_drop_types`)
 - rust-lang/rust#161424 (implement `VaArgSafe` for `f128`)
 - rust-lang/rust#161777 (Add Natvis visualiser and debuginfo tests for `f128`)
 - rust-lang/rust#162506 (Avoid suggesting imports of traits declared inside fn bodies)
 - rust-lang/rust#162591 (Move parse error recovery for expression operators "out of line" & refactor in the area)
 - rust-lang/rust#162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names)
 - rust-lang/rust#162733 (Add useful APIs to `Unique(Arc|Rc)`)
 - rust-lang/rust#162913 (Refactor LivenessResults into LivenessComputation, without typeck)
 - rust-lang/rust#162924 (Remove applying inline attributes at the callsite)
 - rust-lang/rust#162940 (Use spawned `SBDebugger` instance)
 - rust-lang/rust#162950 (More AST lowering cleanups)
 - rust-lang/rust#162964 (Update `browser-ui-test` version to `0.25.2`)
 - rust-lang/rust#162979 (mark `f128` as reliable on `powerpc64` with `+vsx`)
 - rust-lang/rust#161743 (Add performance notes for the floating-point round method)
 - rust-lang/rust#162797 (yeet AliasConstKind::opt_def_id)
 - rust-lang/rust#162836 (Ping T-libs-ping instead of T-libs-fcp for backports)
 - rust-lang/rust#162873 (Adjust `bug!`/`span_bug!` emission)
 - rust-lang/rust#162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests)
 - rust-lang/rust#162971 (libtest harness: avoid 'extern crate test' with custom runner)
 - rust-lang/rust#162981 (rustc-dev-guide subtree update)
 - rust-lang/rust#162985 (Error on invalid placements for unstable attributes)
@nnethercote
nnethercote deleted the more-lowering-cleanups branch September 20, 2026 21:32
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants