-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 is parsing email link literals in docs as intradoc links in the latest nightly #83859
Comments
This turned out to be a bug in my docs; I didn't intend for this to be rendered as a |
I think this PR introduced this new behavior: #83543. |
This is weird - rustdoc should be ignoring any link that has
|
Ah I see the issue -
|
@lopopolo I'm confused. After #83865 there won't be an error message, because the link shouldn't have been treated as an intra-doc link in the first place. Are you asking for a lint that warns about docs that will be rendered as mailto: links? I'm not sure how useful that is, mailto: links are normal and reasonable to write. |
@jyn514 based on the UI tests that are checked in, if I actually intend to use an intradoc link with a disambiguator and fat finger |
Hmm, what would you like to see instead? There's quite a few valid disambiguators, I'm not sure it makes sense to list them all. Maybe we could add a header to the disambiguator section of https://doc.rust-lang.org/rustdoc/linking-to-items-by-name.html and link there? |
Ideally I'd like to see a suggestion to use a disambiguator that corresponds to an item that is currently in scope or otherwise resolvable via the path after the invalid disambiguator. |
Hmm, that seems useful, although I think it should be a separate issue. Maybe we could try resolving without a disambiguator and see if there are any results? That would need a pretty significant overhaul of how it works currently, right now all the errors are emitted eagerly which would end up with a lot more verbose output that might not be relevant. What would you expect to see if the link isn't valid even without the disambiguator? |
@jyn514 I think an extra The idea to attempt to resolve items for all invalid disambiguators feels similar to the Ruby CLI and REPL's "did you mean" feature, which I find quite useful. |
Don't report disambiguator error if link would have been ignored Fixes rust-lang#83859. This prevents us from warning on links such as `<hello@example.com>`. Note that we still warn on links such as `<hello@localhost>` because they have no dots in them. However, the links will still work, even though a warning is reported. r? ``@jyn514``
Don't report disambiguator error if link would have been ignored Fixes rust-lang#83859. This prevents us from warning on links such as `<hello@example.com>`. Note that we still warn on links such as `<hello@localhost>` because they have no dots in them. However, the links will still work, even though a warning is reported. r? `@jyn514`
Don't report disambiguator error if link would have been ignored Fixes rust-lang#83859. This prevents us from warning on links such as `<hello@example.com>`. Note that we still warn on links such as `<hello@localhost>` because they have no dots in them. However, the links will still work, even though a warning is reported. r? ```@jyn514```
rustdoc: Link to the docs on namespaces when an unknown disambiguator is found cc rust-lang#83859 `@lopopolo` does this look about like what you expected? r? `@camelid`
rustdoc: Link to the docs on namespaces when an unknown disambiguator is found cc rust-lang#83859 `@lopopolo` does this look about like what you expected? r? `@camelid`
The PR improving the diagnostics is being reverted in #84950, reopening the issue. |
@pietroalbini I don't think this is still a regression; the diagnostics improvement was not part of the fix for the regression. (The regression was fixed in #83865.) |
Yeah, #83866 never had a tracking issue. |
I tried this code:
I expected to see this happen: rustdoc parses the link as an email address and renders it as a mailto: link.
Instead, this happened:
Meta
(from a GitHub Actions run, the latest nightly won't install on my Arch box due to broken components)
The text was updated successfully, but these errors were encountered: