Skip to content

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Sep 22, 2025

See my notes in https://hackmd.io/4ILASx3mQ3u_gW9r1JyqCw.

This PR builds on #145993 and allows not-yet defined opaque types as self types in the method_autoderef_chain.

E.g. for Box<impl Deref<impl Foo>> this results in the autoderef chain Box<impl Deref> -> ?deref_hidden_ty -> ?foo_hidden_ty. Method selection stays ambiguous if the final autoderef step is still an infer var unless that var is an opaque.

TODO: treating opaques as rigid jank.

r? @BoxyUwU

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 22, 2025

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

@lcnr lcnr marked this pull request as draft September 22, 2025 12:27
@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 Sep 22, 2025
@rust-log-analyzer

This comment has been minimized.

@lcnr lcnr force-pushed the method-selection-opaques branch from 9071886 to 0cf7b6a Compare September 23, 2025 07:40
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lcnr lcnr force-pushed the method-selection-opaques branch from 45af29b to 25acecb Compare September 23, 2025 13:10
@rust-log-analyzer

This comment has been minimized.

@lcnr lcnr force-pushed the method-selection-opaques branch from 25acecb to cb38942 Compare September 23, 2025 13:59
@lcnr lcnr marked this pull request as ready for review September 23, 2025 14:01
@rustbot
Copy link
Collaborator

rustbot commented Sep 23, 2025

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

@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 Sep 23, 2025
@BoxyUwU BoxyUwU added the S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. label Sep 23, 2025
@rust-log-analyzer

This comment has been minimized.

@lcnr lcnr force-pushed the method-selection-opaques branch from cb38942 to be0f84f Compare September 23, 2025 14:25
@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor Author

lcnr commented Sep 23, 2025

@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 23, 2025
support opaque types in method selection
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 23, 2025
@lcnr lcnr force-pushed the method-selection-opaques branch from be0f84f to 0050715 Compare September 23, 2025 15:33
@rustbot

This comment has been minimized.

`autoderef` already resolved and `method_autoderef_steps` makes
sure we won't encounter an inference variable
We'll still error due to the `opt_bad_ty` of `method_autoderef_steps`.
This slightly worsens the span of `infer_var.method()` which is now the
same as for `Box::new(infer_var).method()`.

Unlike `structurally_resolve_type`, `probe_op` does not check whether
the infcx is already tainted, so this results in 2 previously not emitted
errors.
@lcnr lcnr force-pushed the method-selection-opaques branch from 8ff5eee to c2e39c2 Compare September 26, 2025 14:37
@rustbot
Copy link
Collaborator

rustbot commented Sep 26, 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.

@lcnr
Copy link
Contributor Author

lcnr commented Sep 26, 2025

@bors r=BoxyUwU

@bors
Copy link
Collaborator

bors commented Sep 26, 2025

📌 Commit c2e39c2 has been approved by BoxyUwU

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 Sep 26, 2025
@bors
Copy link
Collaborator

bors commented Sep 26, 2025

⌛ Testing commit c2e39c2 with merge 54a8a1d...

@bors
Copy link
Collaborator

bors commented Sep 26, 2025

☀️ Test successful - checks-actions
Approved by: BoxyUwU
Pushing 54a8a1d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 26, 2025
@bors bors merged commit 54a8a1d into rust-lang:master Sep 26, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 26, 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 a885811 (parent) -> 54a8a1d (this PR)

Test differences

Show 102 test diffs

Stage 1

  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref.rs#current: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref.rs#next: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution.rs#current: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution.rs#next: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution2.rs#current: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution2.rs#next: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution3.rs#current: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution3.rs#next: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution4.rs#current: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method-resolution4.rs#next: pass -> [missing] (J0)
  • [ui] tests/ui/impl-trait/method/broken-deref-chain.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/broken-deref-chain.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution2.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution2.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution3.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution3.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution4.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution4.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/would-constrain-opaque.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/impl-trait/method/would-constrain-opaque.rs#next: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref.rs#current: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/call_method_on_inherent_impl_ref.rs#next: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution.rs#current: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution.rs#next: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution2.rs#current: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution2.rs#next: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution3.rs#current: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution3.rs#next: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution4.rs#current: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method-resolution4.rs#next: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/method/broken-deref-chain.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/broken-deref-chain.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution2.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution2.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution3.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution3.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution4.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution4.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/method-resolution5-deref.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/would-constrain-opaque.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/impl-trait/method/would-constrain-opaque.rs#next: [missing] -> pass (J1)

Additionally, 42 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 54a8a1db604e4caff93e26e167ad4a6fde9f0681 --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-x86_64-apple: 6007.1s -> 7673.7s (27.7%)
  2. aarch64-gnu: 6194.1s -> 7135.6s (15.2%)
  3. x86_64-gnu-llvm-20: 2415.8s -> 2778.8s (15.0%)
  4. aarch64-msvc-2: 5532.7s -> 4829.1s (-12.7%)
  5. x86_64-msvc-ext3: 6767.8s -> 5965.2s (-11.9%)
  6. aarch64-gnu-llvm-20-1: 3259.0s -> 3640.7s (11.7%)
  7. dist-aarch64-apple: 8584.1s -> 7592.3s (-11.6%)
  8. pr-check-1: 1381.0s -> 1539.3s (11.5%)
  9. dist-s390x-linux: 4985.6s -> 5514.8s (10.6%)
  10. i686-msvc-1: 10652.5s -> 9559.5s (-10.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 (54a8a1d): comparison URL.

Overall result: ✅ 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 10
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

Results (primary 3.5%, secondary 10.1%)

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

mean range count
Regressions ❌
(primary)
3.5% [2.9%, 4.1%] 4
Regressions ❌
(secondary)
10.1% [5.1%, 15.2%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.5% [2.9%, 4.1%] 4

Binary size

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

Bootstrap: 470.315s -> 471.437s (0.24%)
Artifact size: 388.10 MiB -> 388.14 MiB (0.01%)

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. S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants