Skip to content

Retire hir::*ItemRef. #143357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 14, 2025
Merged

Retire hir::*ItemRef. #143357

merged 8 commits into from
Jul 14, 2025

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 3, 2025

This information was kept for various places that iterate on HIR to know about trait-items and impl-items.

This PR replaces them by uses of the associated_items query that contain pretty much the same information.

This shortens many spans to just def_span, which can be easier to read.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. labels Jul 3, 2025
@cjgillot cjgillot force-pushed the no-assoc-item-kind branch from 1264eb5 to 4e5d3e2 Compare July 3, 2025 11:03
@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 3, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 3, 2025
@bors
Copy link
Collaborator

bors commented Jul 3, 2025

⌛ Trying commit 4e5d3e2 with merge 2d047d1...

bors added a commit that referenced this pull request Jul 3, 2025
Retire hir::*ItemRef.

r? `@ghost` for perf
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 3, 2025

☀️ Try build successful - checks-actions
Build commit: 2d047d1 (2d047d1af1d10ea3b11563dc0347bfc68cf188e9)

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 4, 2025

☔ The latest upstream changes (presumably #143390) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 4, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2d047d1): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.2%] 4
Regressions ❌
(secondary)
0.5% [0.2%, 0.7%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.1% [-11.6%, -0.2%] 13
All ❌✅ (primary) 0.2% [0.1%, 0.2%] 4

Max RSS (memory usage)

Results (primary 0.7%, secondary 0.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.9% [1.8%, 2.0%] 2
Regressions ❌
(secondary)
0.9% [0.9%, 0.9%] 1
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [-1.6%, 2.0%] 3

Cycles

Results (secondary -4.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.0% [-8.2%, -3.0%] 8
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 461.527s -> 461.455s (-0.02%)
Artifact size: 372.16 MiB -> 372.04 MiB (-0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 4, 2025
@cjgillot cjgillot marked this pull request as ready for review July 4, 2025 09:53
@rustbot
Copy link
Collaborator

rustbot commented Jul 4, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 4, 2025

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

cc @nnethercote

changes to the core type system

cc @compiler-errors, @lcnr

Some changes occurred in match checking

cc @Nadrieril

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

@cjgillot cjgillot force-pushed the no-assoc-item-kind branch from 643804d to 8063b5b Compare July 4, 2025 10:52
@cjgillot cjgillot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 5, 2025
@bors
Copy link
Collaborator

bors commented Jul 13, 2025

☔ The latest upstream changes (presumably #143783) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot force-pushed the no-assoc-item-kind branch from 8063b5b to 65a5f88 Compare July 13, 2025 13:49
@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Jul 13, 2025
@cjgillot cjgillot force-pushed the no-assoc-item-kind branch from 65a5f88 to 27127e3 Compare July 13, 2025 13:50
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

LGTM. Some naming questions, but perhaps best saved for a follow-up.

let TraitItemRef { id, ident: _, kind: _, span: _ } = *ii;

self.visit_nested_trait_item(id);
fn visit_trait_item_ref(&mut self, id: &'hir TraitItemId) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is it still called visit_trait_item_ref? Should we give this a better name?

ident: self.lower_ident(i.kind.ident().unwrap()),
span: self.lower_span(i.span),
}
fn lower_foreign_item_ref(&mut self, i: &ForeignItem) -> hir::ForeignItemId {
Copy link
Member

Choose a reason for hiding this comment

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

Likewise naming

@compiler-errors
Copy link
Member

r? compiler-errors @bors r+

@bors
Copy link
Collaborator

bors commented Jul 13, 2025

📌 Commit 27127e3 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors 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 Jul 13, 2025
@bors
Copy link
Collaborator

bors commented Jul 13, 2025

⌛ Testing commit 27127e3 with merge 9c3064e...

@bors
Copy link
Collaborator

bors commented Jul 14, 2025

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 9c3064e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 14, 2025
@bors bors merged commit 9c3064e into rust-lang:master Jul 14, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 14, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing e9182f1 (parent) -> 9c3064e (this PR)

Test differences

Show 40 test diffs

40 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 9c3064e131f4939cc95a29bb11413c49bbda1491 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 3156.9s -> 4214.5s (33.5%)
  2. dist-aarch64-linux: 6326.0s -> 8137.9s (28.6%)
  3. dist-x86_64-apple: 7755.2s -> 9338.3s (20.4%)
  4. pr-check-2: 2211.0s -> 2645.0s (19.6%)
  5. aarch64-apple: 4095.4s -> 4724.2s (15.4%)
  6. aarch64-gnu-debug: 3670.8s -> 4199.5s (14.4%)
  7. x86_64-gnu-tools: 3220.7s -> 3674.2s (14.1%)
  8. i686-gnu-2: 5526.6s -> 6270.8s (13.5%)
  9. x86_64-gnu-llvm-19-1: 3305.9s -> 3717.5s (12.5%)
  10. i686-gnu-1: 7197.3s -> 8081.1s (12.3%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9c3064e): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 6
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
-4.8% [-11.6%, -0.2%] 14
All ❌✅ (primary) 0.0% [-0.1%, 0.2%] 2

Max RSS (memory usage)

Results (primary 1.5%, secondary -2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 1

Cycles

Results (secondary -4.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
8.2% [8.2%, 8.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.9% [-8.7%, -4.7%] 6
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 464.056s -> 462.57s (-0.32%)
Artifact size: 374.70 MiB -> 374.65 MiB (-0.01%)

@cjgillot cjgillot deleted the no-assoc-item-kind branch July 14, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants