-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Add regression test for #137857 to ensure that we generate intra doc links for extern crate items. #142367
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
Add regression test for #137857 to ensure that we generate intra doc links for extern crate items. #142367
Conversation
This comment has been minimized.
This comment has been minimized.
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.
A few things I think could be done to improve readability for future maintainers, actual semantics of the test seems correct.
tests/rustdoc/intra-doc/deps.rs
Outdated
//@ compile-flags: --document-private-items -Z unstable-options | ||
//@ compile-flags: --extern-html-root-url=empty=https://docs.rs/ | ||
// This one is to ensure that we don't link "by default" any item we see which has | ||
// an external html root URL. | ||
//@ compile-flags: --extern-html-root-url=non_existent=https://docs.rs/ |
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.
//@ compile-flags: --document-private-items -Z unstable-options | |
//@ compile-flags: --extern-html-root-url=empty=https://docs.rs/ | |
// This one is to ensure that we don't link "by default" any item we see which has | |
// an external html root URL. | |
//@ compile-flags: --extern-html-root-url=non_existent=https://docs.rs/ | |
//@ compile-flags: --document-private-items -Z unstable-options | |
//@ compile-flags: --extern-html-root-url=empty=https://empty.example/ | |
// This one is to ensure that we don't link to any item we see which has | |
// an external html root URL unless it actually exists | |
//@ compile-flags: --extern-html-root-url=non_existent=https://non-existant.example/ |
I think it is confusing to give a value that is similar to a real value, but which is incorrect if you wanted the link to actually work.
Using obvious placeholder values should hopefully be more clear (.example
in particular is reserved as a gTLD that will never actually be used)
7b345fa
to
1c6b2d4
Compare
This comment has been minimized.
This comment has been minimized.
Applied suggestions! |
…ntra doc links for extern crate items.
1c6b2d4
to
1052ddd
Compare
|
Applied suggestion (updated comment and updated URL). |
@bors r=lolbinarycat rollup |
Rollup of 11 pull requests Successful merges: - #142021 (Doc: clarify priority of lint level sources) - #142367 (Add regression test for #137857 to ensure that we generate intra doc links for extern crate items.) - #142641 (Generate symbols.o for proc-macros too) - #142889 (Clarify doc comment on unix OpenOptions) - #143063 (explain `ImportData::imported_module`) - #143088 (Improve documentation of `TagEncoding`) - #143135 (fix typos on some doc comments) - #143138 (Port `#[link_name]` to the new attribute parsing infrastructure) - #143155 (`librustdoc` house-keeping 🧹) - #143169 (Remove unused feature gates) - #143171 (Fix the span of trait bound modifier `[const]`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142367 - GuillaumeGomez:extern-crate-items-intra-doc, r=lolbinarycat Add regression test for #137857 to ensure that we generate intra doc links for extern crate items. Fixes #137857. I checked that linking to extern crates was generating valid links (with the `/index.html` part) and since it's already working, just adding a regression test. r? `@notriddle`
Fixes #137857.
I checked that linking to extern crates was generating valid links (with the
/index.html
part) and since it's already working, just adding a regression test.r? @notriddle