Skip to content

Conversation

@camsteffen
Copy link
Contributor

@camsteffen camsteffen commented Sep 1, 2025

This is a prerequisite to removing QPath::LangItem (#115178) because otherwise there would be no way to detect a range expression in the HIR.

There are some non-obvious Clippy changes so a Clippy team review would be good.

@rustbot
Copy link
Collaborator

rustbot commented Sep 1, 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 S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 1, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@camsteffen camsteffen force-pushed the range-desugar-span branch 3 times, most recently from b4bfa81 to ac6978f Compare September 1, 2025 17:46
@rustbot

This comment has been minimized.

@camsteffen
Copy link
Contributor Author

@SparrowLii are you able to review?

Copy link
Member

@SparrowLii SparrowLii left a comment

Choose a reason for hiding this comment

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

Sorry for the late reviewing. The impl looks good to me. I'd like to run a perf test. We can merge it if there's no regression

View changes since this review

@SparrowLii
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 30, 2025
Mark desugared range expression spans with DesugaringKind::RangeExpr
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 30, 2025
@rust-bors
Copy link

rust-bors bot commented Sep 30, 2025

☀️ Try build successful (CI)
Build commit: b4fcc0d (b4fcc0d45ab65abcfb6750a45343c0226167f12e, parent: c5dc558e6cca43958616b268b66c49763f2e9e9a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b4fcc0d): comparison URL.

Overall result: ❌ regressions - 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.3% [0.2%, 0.4%] 13
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 14
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.4%] 13

Max RSS (memory usage)

Results (primary 1.0%)

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

mean range count
Regressions ❌
(primary)
1.0% [0.8%, 1.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.0% [0.8%, 1.2%] 2

Cycles

Results (primary 2.2%, secondary 6.5%)

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

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

Binary size

Results (primary 0.1%, secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.5%] 73
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.5%] 73

Bootstrap: 468.849s -> 470.946s (0.45%)
Artifact size: 387.70 MiB -> 387.73 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 30, 2025
@camsteffen
Copy link
Contributor Author

Just a guess but let's see if that fixes it.

@SparrowLii
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 9, 2025
Mark desugared range expression spans with DesugaringKind::RangeExpr
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 9, 2025
@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 9, 2025
@camsteffen
Copy link
Contributor Author

Those results are worse so I took that commit back. I'm not finding anything actionable in cachegrind. I think this is a mixture of some noise and some inevitable loss with creating more span contexts.

@rustbot

This comment has been minimized.

@camsteffen camsteffen force-pushed the range-desugar-span branch 2 times, most recently from 7dce8b2 to b8af04c Compare October 9, 2025 15:54
@rustbot

This comment has been minimized.

@SparrowLii
Copy link
Member

SparrowLii commented Oct 11, 2025

We focus on the primary cases so I think the second impl and results are a bit better. Collecting lang items in HIR is very valuable so the regression doesn't block this PR IMO. Just seeing if there are some optimiztions. Anyway I think we can merge it next week.

@SparrowLii
Copy link
Member

@camsteffen Could you re-push the commit which generates the soecend perf resutlts? Then I can give a r+

The need for this arose when encountering range expressions surrounded
by parenthesis, where we want the span desugaring mark to be preserved.
@rustbot
Copy link
Collaborator

rustbot commented Oct 21, 2025

This PR was rebased onto a different master 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.

@camsteffen
Copy link
Contributor Author

Ok, I squashed it in. Sorry for the delay, I think I misunderstood your comment before.

@SparrowLii
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Oct 27, 2025

📌 Commit 6d61dad has been approved by SparrowLii

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 Oct 27, 2025
@bors
Copy link
Collaborator

bors commented Oct 27, 2025

⌛ Testing commit 6d61dad with merge 23fced0...

@bors
Copy link
Collaborator

bors commented Oct 27, 2025

☀️ Test successful - checks-actions
Approved by: SparrowLii
Pushing 23fced0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 27, 2025
@bors bors merged commit 23fced0 into rust-lang:master Oct 27, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Oct 27, 2025
@github-actions
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 b1b464d (parent) -> 23fced0 (this PR)

Test differences

Show 26 test diffs

26 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 23fced0fcc5e0ec260d25f04a8b78b269e5e90f0 --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. pr-check-1: 1482.8s -> 1931.4s (30.3%)
  2. aarch64-msvc-2: 5095.3s -> 6228.7s (22.2%)
  3. i686-gnu-nopt-1: 6862.5s -> 7962.6s (16.0%)
  4. i686-gnu-2: 5463.9s -> 6335.6s (16.0%)
  5. armhf-gnu: 4922.1s -> 5702.6s (15.9%)
  6. dist-x86_64-apple: 6842.9s -> 7865.4s (14.9%)
  7. aarch64-gnu-llvm-20-1: 3207.8s -> 3685.6s (14.9%)
  8. aarch64-gnu-llvm-20-2: 2168.3s -> 2486.0s (14.7%)
  9. x86_64-gnu-tools: 3360.2s -> 3772.8s (12.3%)
  10. x86_64-gnu-gcc: 3077.2s -> 3454.3s (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 (23fced0): comparison URL.

Overall result: ❌ regressions - 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.1%, 0.3%] 8
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 13
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 8

Max RSS (memory usage)

Results (primary 0.5%, secondary 4.0%)

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

mean range count
Regressions ❌
(primary)
1.7% [0.8%, 3.0%] 3
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-3.1%, 3.0%] 4

Cycles

Results (secondary 1.6%)

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.9% [2.9%, 6.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.0% [-5.0%, -5.0%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.1%, secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.5%] 74
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.5%] 74

Bootstrap: 474.573s -> 475.144s (0.12%)
Artifact size: 390.41 MiB -> 390.52 MiB (0.03%)

@camsteffen camsteffen deleted the range-desugar-span branch October 27, 2025 13:01
@panstromek
Copy link
Contributor

perf triage:

Regression was deemed acceptable here: #146069 (comment)

Note that the regression mostly affects very short benchmarks (incr-unchanged and such), so this is not as bad as it might seem from the summary.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 27, 2025
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 31, 2025
…rrowLii

Mark desugared range expression spans with DesugaringKind::RangeExpr

This is a prerequisite to removing `QPath::LangItem` (rust-lang#115178) because otherwise there would be no way to detect a range expression in the HIR.

There are some non-obvious Clippy changes so a Clippy team review would be good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants