-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
Some changes occurred in intra-doc-links. cc @jyn514 |
(rust-highfive has picked a reviewer for you, use r? to override) |
--> $DIR/field-ice.rs:5:6 | ||
| | ||
LL | /// [`Foo::bar()`] | ||
| ^^^^^^^^^^^^ help: to link to the field, remove the disambiguator: ``Foo::bar`` |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
This comment has been minimized.
This comment has been minimized.
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+) |
✌️ @fee1-dead can now approve this pull request |
@bors r=jyn514 |
📌 Commit 3dab2d2 has been approved by |
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
This fixes #85615.
@rustbot label T-rustdoc