Skip to content

Conversation

camsteffen
Copy link
Contributor

@camsteffen camsteffen commented Jul 28, 2025

Changes impl_trait_header to panic on inherent impls intstead of returning None. A few downstream functions are split into option and non-option returning functions. This gets rid of a lot of unwraps where we know we have a trait impl, while there are still some cases where the Option is helpful.

Summary of changes to tcx methods:

  • impl_is_of_trait (new)
  • impl_trait_header -> impl_trait_header/impl_opt_trait_header
  • impl_trait_ref -> impl_trait_ref/impl_opt_trait_ref
  • trait_id_of_impl -> impl_trait_id/impl_opt_trait_id

@rustbot
Copy link
Collaborator

rustbot commented Jul 28, 2025

r? @jackh726

rustbot has assigned @jackh726.
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 A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. PG-exploit-mitigations Project group: Exploit mitigations 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 28, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in compiler/rustc_sanitizers

cc @rcvalle

HIR ty lowering was modified

cc @fmease

@rust-log-analyzer

This comment has been minimized.

@lqd
Copy link
Member

lqd commented Jul 28, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jul 28, 2025
Limit impl_trait_header query to only trait impls
@rust-bors
Copy link

rust-bors bot commented Jul 28, 2025

⌛ Trying commit c4b4025 with merge a9207a1

To cancel the try build, run the command @bors try cancel.

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

rust-bors bot commented Jul 28, 2025

💔 Test failed (CI). Failed jobs:

@camsteffen camsteffen force-pushed the impl-trait-header-option branch from c4b4025 to 35dbd1a Compare July 28, 2025 22:35
@camsteffen
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-bors
Copy link

rust-bors bot commented Jul 28, 2025

@camsteffen: 🔑 Insufficient privileges: not in try users

@rust-timer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lqd
Copy link
Member

lqd commented Jul 29, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jul 29, 2025
Limit impl_trait_header query to only trait impls
@rust-bors
Copy link

rust-bors bot commented Jul 29, 2025

⌛ Trying commit 35dbd1a with merge 60b45cb

To cancel the try build, run the command @bors try cancel.

@rust-bors
Copy link

rust-bors bot commented Jul 29, 2025

☀️ Try build successful (CI)
Build commit: 60b45cb (60b45cbaa7a7f0ea8340063c9bbac4ed081c245a, parent: cdccba87bf9ad5d87c1417eeb8fa52a4b614bbf9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (60b45cb): comparison URL.

Overall result: ❌✅ regressions and improvements - BENCHMARK(S) FAILED

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

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • eza-0.21.2
  • externs
  • include-blob
  • clap_derive-4.5.32
  • serde-1.0.219
  • wg-grammar
  • syn-2.0.101
  • unify-linearly
  • ucd
  • serde_derive-1.0.219
  • cranelift-codegen-0.119.0
  • regression-31157
  • diesel-2.2.10
  • bitmaps-3.2.1
  • hyper-1.6.0
  • ripgrep-14.1.1
  • tuple-stress
  • match-stress
  • ctfe-stress-5
  • derive
  • deeply-nested-multi
  • helloworld
  • unicode-normalization-0.1.24
  • wf-projection-stress-65510
  • coercions
  • stm32f4-0.15.1
  • issue-58319
  • html5ever-0.31.0
  • projection-caching
  • token-stream-stress
  • tt-muncher
  • serde-1.0.219-threads4
  • large-workspace
  • nalgebra-0.33.0
  • many-assoc-items
  • issue-46449
  • image-0.25.6
  • cargo-0.87.1
  • typenum-1.18.0
  • unused-warnings
  • await-call-tree
  • regex-automata-0.4.8
  • issue-88862
  • deep-vector
  • libc-0.2.172

❗ ❗ ❗ ❗ ❗

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)
2.4% [0.2%, 3.7%] 9
Regressions ❌
(secondary)
0.5% [0.4%, 0.5%] 3
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) 2.1% [-0.2%, 3.7%] 10

Max RSS (memory usage)

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

Cycles

Results (secondary -2.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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-3.1%, -2.3%] 5
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 469.046s -> 466.887s (-0.46%)
Artifact size: 376.81 MiB -> 376.87 MiB (0.02%)

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

camsteffen commented Jul 29, 2025

Y'all think that's funny? 😤

Fixed the rustdoc issues from above.

@bors
Copy link
Collaborator

bors commented Oct 17, 2025

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

@camsteffen camsteffen force-pushed the impl-trait-header-option branch from d111d39 to d9a5389 Compare October 17, 2025 13:37
@rustbot
Copy link
Collaborator

rustbot commented Oct 17, 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

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Oct 17, 2025

📌 Commit d9a5389 has been approved by lcnr

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 17, 2025
@bors
Copy link
Collaborator

bors commented Oct 18, 2025

⌛ Testing commit d9a5389 with merge 2170b4d...

@bors
Copy link
Collaborator

bors commented Oct 18, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 2170b4d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 18, 2025
@bors bors merged commit 2170b4d into rust-lang:master Oct 18, 2025
12 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 18, 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 28fad95 (parent) -> 2170b4d (this PR)

Test differences

Show 100 test diffs

100 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 2170b4da847c9d75d400b13ba53bd47f749233bd --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: 1441.0s -> 1756.7s (21.9%)
  2. dist-apple-various: 4004.2s -> 3440.0s (-14.1%)
  3. aarch64-apple: 7459.1s -> 8256.0s (10.7%)
  4. dist-s390x-linux: 4846.4s -> 5346.6s (10.3%)
  5. x86_64-gnu-llvm-20: 2805.8s -> 2525.1s (-10.0%)
  6. armhf-gnu: 4825.4s -> 5270.2s (9.2%)
  7. x86_64-rust-for-linux: 2736.4s -> 2976.1s (8.8%)
  8. aarch64-msvc-2: 5142.0s -> 4691.7s (-8.8%)
  9. x86_64-gnu-miri: 4714.8s -> 4302.3s (-8.7%)
  10. x86_64-gnu-debug: 6680.5s -> 7233.0s (8.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 (2170b4d): 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.2% [0.1%, 0.2%] 11
Improvements ✅
(primary)
-0.6% [-0.8%, -0.4%] 7
Improvements ✅
(secondary)
-1.8% [-2.6%, -0.1%] 4
All ❌✅ (primary) -0.5% [-0.8%, 0.2%] 8

Max RSS (memory usage)

Results (primary -0.4%)

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

mean range count
Regressions ❌
(primary)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.0% [-3.3%, -0.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-3.3%, 2.9%] 3

Cycles

Results (primary 3.0%, 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)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.0% [-4.9%, -2.7%] 3
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Binary size

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

Bootstrap: 475.32s -> 475.309s (-0.00%)
Artifact size: 390.35 MiB -> 390.33 MiB (-0.00%)

@Mark-Simulacrum
Copy link
Member

Some regressions on smaller benchmarks. My guess is that this hurts the case where there's lots of opt function lookups for that are now two query cache hit lookups rather than just one? But that seems to generally be less likely in our benchmarks than showing an improvement, so willing to just accept the regressions.

@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Oct 21, 2025
tautschnig added a commit to model-checking/kani that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. PG-exploit-mitigations Project group: Exploit mitigations 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.