Add regression test for #137857 to ensure that we generate intra doc links for extern crate items.#142367
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 29, 2025
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
lolbinarycat
left a comment
There was a problem hiding this comment.
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
Comment on lines
+4
to
+8
| //@ 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/ |
Contributor
There was a problem hiding this comment.
Suggested change
| //@ 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.
Member
Author
|
Applied suggestions! |
…ntra doc links for extern crate items.
1c6b2d4 to
1052ddd
Compare
Collaborator
|
Member
Author
|
Applied suggestion (updated comment and updated URL). |
lolbinarycat
approved these changes
Jun 28, 2025
Member
Author
|
@bors r=lolbinarycat rollup |
Collaborator
bors
added a commit
that referenced
this pull request
Jun 29, 2025
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
rust-timer
added a commit
that referenced
this pull request
Jun 29, 2025
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #137857.
I checked that linking to extern crates was generating valid links (with the
/index.htmlpart) and since it's already working, just adding a regression test.r? @notriddle