Skip to content

Conversation

@matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Oct 28, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bjorn3 and others added 9 commits October 27, 2025 15:56
Previously only --crate-type would be taken into account, not #![crate_type].
This way cargo will drop the unsupported crate types for crates that
specify multiple crate types.
This option hasn't done anything for a long time, and can be
removed. I've kept a shim in place to avoid breaking docs.rs,
but the option no longer does anything.

Using git-blame, I tracked this option down to
f77ebd4, the commit that
introduced EmitType in the first place. It was used with
SharedResource::Unversioned, which no longer exists since
f9e1f6f removed them.

CC rust-lang#146220
Part of rust-lang#83784
Emit delayed bug during wfck for stranded opaque

Fixes rust-lang/trait-system-refactor-initiative#235

## Problem

The fundamental issue here is ``OpaqueTypeCollector`` operates on ``rustc_middle::Ty``, but ``check_type_wf`` operates on HIR.

Since [check_type_wf](https://github.com/rust-lang/rust/blob/2f7620a5ccfea7d59d1f500e2a2e59cf1c867a1b/compiler/rustc_hir_analysis/src/check/wfcheck.rs#L2262) operates on HIR, it can see the stranded opaque and tries to infer it's hidden type. But ``OpaqueTypeCollector`` operates on ``rustc_middle::Ty``, so the ``OpaqueTypeCollector`` can no longer see a stranded opaque, hence its hidden type could not be inferred.

As a result, the tests ICE'ed at https://github.com/rust-lang/rust/blob/34a8c7368c84fc699fc83a8851a02f93fd655931/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs#L253

## Proposed solution

This PR detects stranded opaque types during wf check and emit a delayed bug for it.

## Alternative solution

`@BoxyUwU` and I had considered rewriting ``OpaqueTypeCollector`` to be a HIR visitor instead of a ``rustc_middle::Ty`` visitor, but we believe a HIR-based ``OpaqueTypeCollector`` will not work and might not worth the cost of rewriting.

## Acknowledgement

This PR is a joint effort with `@BoxyUwU` :3
…, r=WaffleLapkin

Allow codegen backends to indicate which crate types they support

This way cargo will drop the unsupported crate types for crates that
specify multiple crate types.

This is a prerequisite for rust-lang/miri#4648.
…rces, r=GuillaumeGomez

rustdoc: remove `--emit=unversioned-shared-resources`

This option hasn't done anything for a long time, and can be removed. I've kept a shim in place to avoid breaking docs.rs, but the option no longer does anything.

Using git-blame, I tracked this option down to
f77ebd4, the commit that introduced EmitType in the first place. It was used with SharedResource::Unversioned, which no longer exists since f9e1f6f removed them.

CC rust-lang#146220
Part of rust-lang#83784
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Oct 28, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Oct 28, 2025

📌 Commit 71c4c89 has been approved by matthiaskrgr

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

bors commented Oct 28, 2025

⌛ Testing commit 71c4c89 with merge 278a909...

@bors
Copy link
Collaborator

bors commented Oct 28, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 278a909 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 28, 2025
@bors bors merged commit 278a909 into rust-lang:master Oct 28, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Oct 28, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#148173 Emit delayed bug during wfck for stranded opaque ed23c10fda4202432d0ea9a025f59da2b7b63449 (link)
#148177 Allow codegen backends to indicate which crate types they s… a9f929a8f0738cdfa7789c8307f01f34522d976f (link)
#148180 rustdoc: remove --emit=unversioned-shared-resources 7c423dbcdfdef14307b492f8bb0741c0126fa340 (link)

previous master: bc1d7273df

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@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 bc1d727 (parent) -> 278a909 (this PR)

Test differences

Show 4 test diffs

Stage 1

  • [ui] tests/ui/traits/next-solver/opaques/stranded_opaque.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/traits/next-solver/opaques/stranded_opaque.rs: [missing] -> pass (J0)

Additionally, 2 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 278a90913daf7707791020a592d722dd7971f196 --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: 1300.6s -> 1934.5s (48.7%)
  2. aarch64-apple: 6892.9s -> 9692.6s (40.6%)
  3. pr-check-2: 2378.2s -> 2726.9s (14.7%)
  4. aarch64-msvc-2: 4718.8s -> 5309.5s (12.5%)
  5. dist-i586-gnu-i586-i686-musl: 4750.4s -> 5303.9s (11.7%)
  6. x86_64-gnu-gcc: 3581.2s -> 3174.4s (-11.4%)
  7. tidy: 186.1s -> 204.7s (10.0%)
  8. x86_64-gnu-llvm-20: 2409.5s -> 2646.4s (9.8%)
  9. x86_64-rust-for-linux: 2701.8s -> 2964.6s (9.7%)
  10. dist-powerpc-linux: 5052.6s -> 5524.7s (9.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 (278a909): comparison URL.

Overall result: ❌ regressions - 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.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 3.1%, secondary 3.8%)

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

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
3.8% [3.0%, 4.6%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.1% [3.1%, 3.1%] 1

Cycles

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

Binary size

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

Bootstrap: 475.525s -> 474.493s (-0.22%)
Artifact size: 390.06 MiB -> 390.04 MiB (-0.01%)

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

Labels

A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup 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. T-rustdoc Relevant to the rustdoc 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.

7 participants