Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: prevent ctors from resolving #131224

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

notriddle
Copy link
Contributor

Fixes #130591

@rustbot
Copy link
Collaborator

rustbot commented Oct 4, 2024

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

@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. labels Oct 4, 2024
@notriddle notriddle force-pushed the notriddle/intra-doc-link-value branch from 20380b3 to c52a0f8 Compare October 4, 2024 00:47
@rust-log-analyzer

This comment has been minimized.

@notriddle notriddle force-pushed the notriddle/intra-doc-link-value branch from c52a0f8 to af83c21 Compare October 4, 2024 01:44
@notriddle notriddle changed the title rustdoc: correctly resolve link disambiguators through ctors rustdoc: prevent ctors from resolving Oct 4, 2024
@rust-log-analyzer

This comment has been minimized.

@notriddle notriddle force-pushed the notriddle/intra-doc-link-value branch from af83c21 to 620bd3b Compare October 4, 2024 04:14
@rust-log-analyzer

This comment has been minimized.

@notriddle notriddle force-pushed the notriddle/intra-doc-link-value branch from 620bd3b to 253fec4 Compare October 4, 2024 05:01
@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 4, 2024

📌 Commit 253fec4 has been approved by GuillaumeGomez

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 4, 2024
@bors
Copy link
Contributor

bors commented Oct 4, 2024

⌛ Testing commit 253fec4 with merge 267cf8d...

@bors
Copy link
Contributor

bors commented Oct 4, 2024

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 267cf8d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 4, 2024
@bors bors merged commit 267cf8d into rust-lang:master Oct 4, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 4, 2024
--> $DIR/disambiguator-mismatch.rs:93:14
|
LL | /// Link to [field@S::A]
| ^^^^^^^^^^ this link resolved to a unit variant, which is not a field
| ^^^^^^^^^^ this link resolves to the variant `A`, which is not in the value namespace
Copy link
Member

Choose a reason for hiding this comment

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

this diagnostic change seems like a regression.

Copy link
Member

Choose a reason for hiding this comment

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

Arf indeed. I was too happy about the fix and went too fast over this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be clear, I went with an approach where rustdoc mostly pretends that ctors don't exist at all because:

  1. Having struct@ and variant@ check both the type and value ns's would've cause a perf regression.
  2. Adding a ctor@ disambiguator would've been way too much feature for something that only matters if you do a glob use shadowing hack.

@notriddle notriddle deleted the notriddle/intra-doc-link-value branch October 4, 2024 16:32
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (267cf8d): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 1.5%, secondary 4.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.7% [1.2%, 6.1%] 2
Regressions ❌
(secondary)
4.9% [4.9%, 4.9%] 1
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [-2.7%, 6.1%] 3

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: 772.86s -> 771.923s (-0.12%)
Artifact size: 342.03 MiB -> 342.02 MiB (-0.00%)

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Oct 5, 2024
…error, r=GuillaumeGomez

rustdoc: cleaner errors on disambiguator/namespace mismatches

Resolves rust-lang#131224 (review)

r? `@jyn514`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2024
Rollup merge of rust-lang#131260 - notriddle:notriddle/disambiguator-error, r=GuillaumeGomez

rustdoc: cleaner errors on disambiguator/namespace mismatches

Resolves rust-lang#131224 (review)

r? `@jyn514`
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-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE with intra-doc link [value@Enum::Variant]
7 participants