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: suggest removing disambiguator if linking to field #87078

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

fee1-dead
Copy link
Member

@fee1-dead fee1-dead commented Jul 12, 2021

This fixes #85615.

@rustbot label T-rustdoc

@rust-highfive
Copy link
Collaborator

Some changes occurred in intra-doc-links.

cc @jyn514

@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 12, 2021
@fee1-dead fee1-dead changed the title suggest removing disambiguator if linking to field Rustdoc: suggest removing disambiguator if linking to field Jul 12, 2021
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jul 12, 2021
--> $DIR/field-ice.rs:5:6
|
LL | /// [`Foo::bar()`]
| ^^^^^^^^^^^^ help: to link to the field, remove the disambiguator: ``Foo::bar``
Copy link
Member

@GuillaumeGomez GuillaumeGomez Jul 12, 2021

Choose a reason for hiding this comment

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

The message is really not obvious. What about:

help: to link to the field, remove the parenthesis: `Foo::bar`

? (without the extra backquotes too)

Copy link
Member Author

Choose a reason for hiding this comment

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

the prefix and suffix are all mapped to Disambiguator::Kind(DefKind::Fn):

fn@foo, function@foo, method@foo, and foo().

There are two ways to approach this, either we only allow one kind of those four to exist, or we need to refactor to include that information inside Disambiguator.

Copy link
Member

Choose a reason for hiding this comment

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

either we only allow one kind of those four to exist

This is a breaking change, it's not allowed

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Jul 12, 2021

r=me with CI passing - I agree the diagnostic could be a little better, but that's a pre-existing bug, and this is already way better than the ICE.

@bors delegate=fee1-dead (please use r=jyn514, not r+)

@bors
Copy link
Contributor

bors commented Jul 12, 2021

✌️ @fee1-dead can now approve this pull request

@fee1-dead
Copy link
Member Author

@bors r=jyn514

@bors
Copy link
Contributor

bors commented Jul 12, 2021

📌 Commit 3dab2d2 has been approved by jyn514

@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 Jul 12, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 13, 2021
Rollup of 11 pull requests

Successful merges:

 - rust-lang#86344 (Split MaybeUninit::write into new feature gate and stabilize it)
 - rust-lang#86811 (Remove unstable `io::Cursor::remaining`)
 - rust-lang#86846 (stdio_locked: add tracking issue)
 - rust-lang#86887 (rustdoc: remove dead code in `clean`)
 - rust-lang#87007 (Fix rust-analyzer install when not available.)
 - rust-lang#87035 (Fix implementors display)
 - rust-lang#87065 (Fix ICE with unsized type in const pattern)
 - rust-lang#87070 (Simplify future incompatible reporting.)
 - rust-lang#87077 (:arrow_up: rust-analyzer)
 - rust-lang#87078 (Rustdoc: suggest removing disambiguator if linking to field)
 - rust-lang#87089 (CTFE engine: small cleanups)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 15af98d into rust-lang:master Jul 13, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 13, 2021
@GuillaumeGomez GuillaumeGomez added the A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name label Jul 15, 2021
@fee1-dead fee1-dead deleted the rustdoc branch July 27, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name 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.

rustdoc ICE: "tried to calculate a disambiguator for a def without a namespace?"
7 participants