-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
base: master
Are you sure you want to change the base?
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)
…ntra doc links for extern crate items.
7b345fa
to
1c6b2d4
Compare
|
Applied suggestions! |
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