Skip to content

Conversation

@aerooneqq
Copy link
Contributor

@aerooneqq aerooneqq commented Dec 24, 2025

This PR fixes interaction of recently added recursive delegations with other features, such as generics inheritance and attributes inheritance. It fixes #150152 ICE, it is a part of the delegation feature #118212. This issue contains two examples with different causes of ICE:

  • The cause of the first one is incorrect determination of whether we are in a trait impl here, we were using trait_id.is_some() which in case of an unresolved trait was None, we should have used of_trait from AST level for this purpose
  • The cause of the second example is that with recursive delegations we started to provide DefIds of the root function of the delegation for recursive delegations instead of actual delegee id. This situation is described in comments in DelegationIds struct, now we provide different DefIds (either immediate delegee DefId or the root function DefId in lower_delegation method

Moreover, this PR fixes how attributes inheritance work with recursive delegations, earlier we would have copied attributes from the root function, however now we inherit attributes from the actual delegee, for this purpose we store attributes to inherit for delegations too, in the same way they were stored for functions.

r? @petrochenkov

@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 Dec 24, 2025
@aerooneqq aerooneqq changed the title Generics unreachable ice Recursive delegation improvements Dec 24, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov added the F-fn_delegation `#![feature(fn_delegation)]` label Dec 24, 2025
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 24, 2025
@aerooneqq
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 25, 2025
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 25, 2025
@aerooneqq
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 25, 2025
@petrochenkov
Copy link
Contributor

r=me after squashing commits.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 25, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@aerooneqq aerooneqq force-pushed the generics-unreachable-ice branch from c218251 to 3f477dd Compare December 25, 2025 11:49
@aerooneqq
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 25, 2025
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 25, 2025

📌 Commit 3f477dd has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 25, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 25, 2025
@bors
Copy link
Collaborator

bors commented Dec 25, 2025

⌛ Testing commit 3f477dd with merge a47e39e...

@bors
Copy link
Collaborator

bors commented Dec 25, 2025

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing a47e39e to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 25, 2025
@bors bors merged commit a47e39e into rust-lang:main Dec 25, 2025
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 25, 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 63001d7 (parent) -> a47e39e (this PR)

Test differences

Show 44 test diffs

Stage 1

  • [pretty] tests/pretty/delegation-inline-attribute.rs: [missing] -> pass (J1)
  • [pretty] tests/pretty/delegation_inline_attribute.rs: pass -> [missing] (J1)
  • [ui] tests/ui/delegation/recursive-delegation-ice-150152.rs: [missing] -> pass (J1)

Stage 2

  • [pretty] tests/pretty/delegation-inline-attribute.rs: [missing] -> pass (J0)
  • [pretty] tests/pretty/delegation_inline_attribute.rs: pass -> [missing] (J0)
  • [ui] tests/ui/delegation/recursive-delegation-ice-150152.rs: [missing] -> pass (J2)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard a47e39ea2061c849fc9d3976d37d9e31b23ba531 --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. dist-aarch64-apple: 7993.6s -> 5822.8s (-27.2%)
  2. dist-apple-various: 3354.5s -> 4048.2s (+20.7%)
  3. x86_64-gnu-debug: 7344.8s -> 6611.4s (-10.0%)
  4. x86_64-gnu-nopt: 7910.4s -> 8691.8s (+9.9%)
  5. dist-ohos-x86_64: 4292.6s -> 4713.0s (+9.8%)
  6. aarch64-gnu-llvm-20-2: 3099.2s -> 3391.5s (+9.4%)
  7. dist-loongarch64-musl: 5260.4s -> 5742.5s (+9.2%)
  8. x86_64-mingw-1: 10643.0s -> 9809.6s (-7.8%)
  9. x86_64-gnu-llvm-21-2: 5529.2s -> 5138.5s (-7.1%)
  10. aarch64-apple: 9004.5s -> 9624.4s (+6.9%)
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 (a47e39e): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -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
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 3
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 1

Max RSS (memory usage)

Results (primary 0.7%, 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)
1.6% [0.7%, 2.5%] 2
Regressions ❌
(secondary)
4.9% [4.4%, 5.8%] 6
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
-2.1% [-2.8%, -1.5%] 3
All ❌✅ (primary) 0.7% [-0.9%, 2.5%] 3

Cycles

Results (primary 2.4%, secondary -3.0%)

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

mean range count
Regressions ❌
(primary)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
1.6% [1.6%, 1.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.6% [-6.1%, -2.0%] 7
All ❌✅ (primary) 2.4% [2.4%, 2.4%] 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 5
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 7
All ❌✅ (primary) -0.1% [-0.1%, -0.1%] 5

Bootstrap: 483.496s -> 482.784s (-0.15%)
Artifact size: 390.46 MiB -> 392.42 MiB (0.50%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-fn_delegation `#![feature(fn_delegation)]` merged-by-bors This PR was explicitly merged by bors. 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.

ICE: delegation: unreachable

6 participants