-
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
intra-doc links: Links with unexpected characters are silently ignored #77199
Comments
Update intra-doc link documentation to match the implementation r? `@Manishearth` cc `@camelid` `@m-ou-se` Relevant PRs: - rust-lang#74489 - rust-lang#80181 - rust-lang#76078 - rust-lang#77519 - rust-lang#73101 Relevant issues: - rust-lang#78800 - rust-lang#77200 - rust-lang#77199 / rust-lang#54191 I haven't documented things that I consider 'just bugs', like rust-lang#77732, but I have documented features that aren't implemented, like rust-lang#78800.
FWIW, I think this is less of an issue now, since more characters are allowed in intra-doc links, and thus not ignored. Also, IIRC |
--display-warnings
ignores links with unexpected characters--display-doctest-warnings
ignores links with unexpected characters
@camelid Thanks, I updated the option name. However, I am still not seeing a warning for |
--display-doctest-warnings
ignores links with unexpected characters
I've changed the title since |
That's great. Enabling the warnings by default is much better. |
I see the advantage of enabling them by default, but rustdoc intentionally silently ignores some links to avoid tons of lints being emitted for existing docs. |
This is a duplicate of #54191. |
Is there a plan to allow requesting stricter behavior when |
@dylni what do you mean by stricter behavior? If you mean what's in this issue, I don't think it's a good idea for rustdoc to decide whether to resolve a link based on an option; it already does that for --document-private-items and it's pretty confusing IMO. If you mean something else, please open a new issue; I'm ok with adding additional lints but I'm not a fan of additional configuration. |
@jyn514 camelid mentioned
I was wondering if there was a particular replacement planned for the option. In the past, it enabled warnings when intra-doc links failed to resolve, but that part seems to be enabled by default now. I was wondering if there's any additional strictness/warnings that would be lost by removing the option.
I agree. It doesn't matter to me if these links are resolved or fail. I would just prefer a warning when they're unresolved. |
Hmm, I didn't realize the flag used to enable intra-doc warnings. My understanding was that it was always used to show warnings in doctests (i.e., |
That was the only reason I mentioned it in this issue. IIRC, at the time this issue was created, not using |
That can't be correct. I started working on intra-doc links about 2 months before you opened the issue and they still gave warnings at that time; AFAIK they've never been behind any sort of feature gate other than originally only being available on nightly. |
Anyway, I think this is a distraction. CLI options seem like the wrong model for this and I don't think we should add more; this should be a new lint if we add it at all. |
I'm going to close this in favor of #54191. |
It's entirely possible this is correct, and you would know better than I. That is just what I recall.
Right, this got a little off-topic.
Thanks for pointing out that issue! |
@dylni Perhaps you were thinking of |
@camelid After investigating a bit, I think I may have falsely attributed the option with showing intra-doc warnings in addition to doctest warnings. Cached compilation not re-issuing warnings was likely what I was seeing instead. Sorry for the confusion. |
Intra-doc links with unexpected characters are ignored here:
rust/src/librustdoc/passes/collect_intra_doc_links.rs
Lines 931 to 933 in 78a0894
However, it would be better if they caused a warning with
--display-doctest-warnings
. Developers might expect[`&[String]`]
to link to the slice primitive, but that link would be ignored without a warning.cc @jyn514
cc #76106 (comment)
The text was updated successfully, but these errors were encountered: