Skip to content

rustdoc: Clean inlined assoc items in their own param-env - #165699

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
lapla-cogito:issue_165186
Nov 18, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
lapla-cogito:issue_165186

Conversation

@lapla-cogito

@lapla-cogito lapla-cogito commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

When inlining associated items from another crate, clean_middle_assoc_item cleaned them in the param-env of their parent impl or trait. That param-env doesn't contain the item's own generic parameters, so normalizing a signature that mentions them could fail. In particular, normalizing a generic const item such as [u8; P::<N>], where N is a const parameter of the associated item itself, made the new solver ICE because it couldn't find the type of N in the param-env.

Fixes #165186

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. labels Nov 9, 2026
@rustbot

rustbot commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: rustdoc
  • rustdoc expanded to 8 candidates
  • Random selection from GuillaumeGomez, fmease, lolbinarycat, notriddle

@GuillaumeGomez

Copy link
Copy Markdown
Member

I think @fmease is more knowledgeable about this.

r? @fmease

@rustbot rustbot assigned fmease and unassigned GuillaumeGomez Nov 9, 2026
impl S {
pub fn f<const N: usize>(_: [u8; P::<N>]) {}

pub const C<const N: usize>: [u8; P::<N>] = [0; P::<N>];

@lapla-cogito lapla-cogito Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

While not reported in the issue, the same ICE occurred in the Const/Type branch as well rather than Fn, so this test makes sure to test those as well.

View changes since the review

@fmease

fmease commented Nov 9, 2026

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 9, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 9, 2026
rustdoc: Clean inlined assoc items in their own param-env
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 84890b7 (84890b7ec36038a65dd5a00d4c499901106aed23)
Base parent: 7f56606 (7f56606f4dd7194a437f3bf2199ab1bd2fd94677)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (84890b7): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@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)
1.6% [0.2%, 9.1%] 47
Regressions ❌
(secondary)
4.5% [0.2%, 9.6%] 55
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [0.2%, 9.1%] 47

Max RSS (memory usage)

Results (primary 1.5%, secondary 2.3%)

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

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 2
Regressions ❌
(secondary)
2.3% [1.1%, 4.8%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 2

Cycles

Results (primary 3.5%, secondary 6.2%)

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

mean range count
Regressions ❌
(primary)
3.5% [1.6%, 8.3%] 16
Regressions ❌
(secondary)
6.2% [2.2%, 8.9%] 37
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.5% [1.6%, 8.3%] 16

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 483.422s -> 484.43s (0.21%)
Artifact size: 406.22 MiB -> 406.28 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 Nov 9, 2026
@fmease

fmease commented Nov 9, 2026

Copy link
Copy Markdown
Member

Perf regression isn't surprising and is acceptable anyway in this case since it fixes a gross correctness violation.

We had a similar situation in the past where we didn't set up the correct paramenv for (inlined) free items.

@GuillaumeGomez

Copy link
Copy Markdown
Member

@fmease: Is the PR ready for merge then? ;)

@fmease fmease left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Perf regression isn't surprising and is acceptable anyway in this case since it fixes a gross correctness violation.

We had a similar situation in the past where we didn't set up the correct paramenv for (inlined) free items.

The PR I alluded to: #120619 (perf report comment).

@rustbot label perf-regression-triaged
@bors r+

View changes since this review

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Nov 16, 2026
@rust-bors

rust-bors Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c290cf4 has been approved by fmease

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 16, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 18, 2026
@rust-bors

rust-bors Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: fmease
Duration: 3h 22m 7s
Pushing 6c587fd to main...

@rust-bors
rust-bors Bot merged commit 6c587fd into rust-lang:main Nov 18, 2026
16 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 18, 2026
@lapla-cogito
lapla-cogito deleted the issue_165186 branch November 18, 2026 06:38
@github-actions

Copy link
Copy Markdown
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 ac7bce9 (parent) -> 6c587fd (this PR)

Test differences

Show 6 test diffs

Stage 1

  • [rustdoc-html] tests/rustdoc-html/inline_cross/generic-const-item-in-assoc-item-sig.rs: [missing] -> pass (J1)

Stage 2

  • [rustdoc-html] tests/rustdoc-html/inline_cross/generic-const-item-in-assoc-item-sig.rs: [missing] -> pass (J0)

Additionally, 4 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 6c587fd5a7f62ceb4fda4e19f0af26d2f9521ae6 --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-various-2: 32m 14s -> 54m 40s (+69.6%)
  2. dist-ohos-x86_64: 55m 48s -> 1h 25m (+53.3%)
  3. test-x86_64-gnu-gcc-core-tests: 17m 41s -> 9m 57s (-43.7%)
  4. test-x86_64-gnu-llvm-22-3: 1h 23m -> 1h 59m (+43.3%)
  5. optional-test-x86_64-gnu-autodiff: 1h -> 35m 21s (-41.2%)
  6. test-x86_64-gnu: 1h 39m -> 2h 20m (+40.8%)
  7. test-aarch64-apple-1: 1h 42m -> 2h 23m (+39.6%)
  8. test-i686-msvc: 2h 25m -> 3h 20m (+37.7%)
  9. dist-x86_64-msvc-alt: 1h 37m -> 2h 12m (+35.2%)
  10. test-x86_64-mingw-1: 2h 23m -> 3h 8m (+31.5%)
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
Copy Markdown

Finished benchmarking commit (6c587fd): comparison URL.

Overall result: ❌ regressions - please read:

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)
1.6% [0.2%, 9.0%] 48
Regressions ❌
(secondary)
4.5% [0.4%, 9.6%] 58
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [0.2%, 9.0%] 48

Max RSS (memory usage)

Results (primary 1.5%, secondary 0.7%)

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

mean range count
Regressions ❌
(primary)
1.9% [1.3%, 4.3%] 6
Regressions ❌
(secondary)
1.3% [0.5%, 2.4%] 11
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-5.0% [-5.0%, -5.0%] 1
All ❌✅ (primary) 1.5% [-1.2%, 4.3%] 7

Cycles

Results (primary 4.1%, secondary 5.6%)

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

mean range count
Regressions ❌
(primary)
4.1% [2.1%, 9.1%] 12
Regressions ❌
(secondary)
6.4% [2.1%, 9.2%] 39
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-0.8%, -0.5%] 5
All ❌✅ (primary) 4.1% [2.1%, 9.1%] 12

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 464.963s -> 464.835s (-0.03%)
Artifact size: 405.36 MiB -> 405.36 MiB (-0.00%)

@panstromek

Copy link
Copy Markdown
Contributor

perf triage:

Correctness fix, justified by #165699 (comment)

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. 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.

[ICE]: rustdoc: cannot find !BoundConst { .. } in param-env when inlining a method whose signature uses a generic const item

6 participants