Resolve crate in intra-doc links properly across crates#77253
Merged
bors merged 2 commits intorust-lang:masterfrom Sep 29, 2020
Merged
Resolve crate in intra-doc links properly across crates#77253bors merged 2 commits intorust-lang:masterfrom
crate in intra-doc links properly across crates#77253bors merged 2 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
crate properly across cratescrate in intra-doc links properly across crates
Member
Author
|
45250f4 to
d4ca2ea
Compare
Contributor
|
Thanks for keeping me updated. |
Previously, `BTreeMap` tried to link to `crate::collections`, intending for the link to go to `std/collections/index.html`. But `BTreeMap` is defined in `alloc`, so after the fix in the previous commit, the links instead went to `alloc/collections/index.html`, which has almost no information. This changes it to link to `index.html`, which only works when viewing from `std::collections::BTreeMap`, the most common place to visit the docs. Fixing it to work from anywhere would require the docs for `std::collections` to be duplicated in `alloc::collections`, which in turn would require HashMap to be `alloc` for intra-doc links to work (rust-lang#74481).
Member
Author
|
Ok, this is ready for review. |
Member
|
@bors r+ |
Collaborator
|
📌 Commit 4065846 has been approved by |
ollie27
reviewed
Sep 28, 2020
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Sep 28, 2020
Resolve `crate` in intra-doc links properly across crates Closes rust-lang#77193; see rust-lang#77193 (comment) for an explanation of what's going on here. ~~This also fixes the BTreeMap docs that have been broken for a while; see the description on the second commit for why and how.~~ Nope, see the second commit for why the link had to be changed. r? @Manishearth cc @dylni @dylni note that this doesn't solve your original problem - now _both_ `with_code` and `crate::with_code` will be broken links. However this will fix a lot of other broken links (in particular I think https://docs.rs/sqlx/0.4.0-beta.1/sqlx/query/struct.Query.html is because of this bug). I'll open another issue for resolving additional docs in the new scope.
Collaborator
Collaborator
|
☀️ Test successful - checks-actions, checks-azure |
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.
Closes #77193; see #77193 (comment) for an explanation of what's going on here.
This also fixes the BTreeMap docs that have been broken for a while; see the description on the second commit for why and how.Nope, see the second commit for why the link had to be changed.r? @Manishearth
cc @dylni
@dylni note that this doesn't solve your original problem - now both
with_codeandcrate::with_codewill be broken links. However this will fix a lot of other broken links (in particular I think https://docs.rs/sqlx/0.4.0-beta.1/sqlx/query/struct.Query.html is because of this bug). I'll open another issue for resolving additional docs in the new scope.