Uh oh!
There was an error while loading. Please reload this page.
Use intra-doc links in str and BTreeSet - #74453
Conversation
rust-highfive
commented
Jul 17, 2020
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
I think this should work:
| /// [`into_iter`]: BTreeSet#method.into_iter | |
| /// [`into_iter`]: BTreeSet::into_iter |
There was a problem hiding this comment.
Do we support <bool as FromStr>::from_str? If not that seems like a good addition, we could also overload <bool as FromStr> to link to the trait implementation. No need to do anything for this PR though.
There was a problem hiding this comment.
Maybe we should strip references automatically? Not sure how that would play with slices eventually though.
There was a problem hiding this comment.
Let's keep the same link text.
| /// into a string slice, use the [`from_utf8`] function. | |
| /// into a string slice, use the [`str::from_utf8`](from_utf8) function. |
There was a problem hiding this comment.
| /// [`as_mut_ptr`]: str::method.as_mut_ptr | |
| /// [`as_mut_ptr`]: str::as_mut_ptr |
There was a problem hiding this comment.
| /// [`split_whitespace`]: str::method.split_whitespace | |
| /// [`split_whitespace`]: str::split_whitespace |
There was a problem hiding this comment.
Hmm, this is not very clear that it's the module and not an associated function ... but I guess as long as the link works it's fine.
There was a problem hiding this comment.
It is, associated functions are Self
jyn514
commented
Jul 17, 2020
Hmm, well it caught at least some of them. but I would still prefer to wait for #71670. |
Manishearth
commented
Jul 17, 2020
Fixed the links. The dot made us treat it as a URL and skip the lint (which is expected). |
jyn514
commented
Jul 17, 2020
Oh huh, I forgot that @lzutao turned on |
Manishearth
commented
Jul 17, 2020
Fixed. We can't link to any libstd things from libcore, so I reverted those. |
jyn514
commented
Jul 17, 2020
r=me once CI is passing |
Manishearth
commented
Jul 17, 2020
@bors r=jyn514 that's what bors is for 😄 (and when making rollups we typically make sure CI is passing) |
bors
commented
Jul 17, 2020
📌 Commit 748634e has been approved by |
ehuss
commented
Jul 18, 2020
This PR introduces quite a few regressions (as also noted in #74061) which I think would be unfortunate to add. In particular, many of the links are switched to remote links to https://doc.rust-lang.org/nightly/. Also, though not as severe, many of the primitive links now go to the module of the same name. |
Manishearth
commented
Jul 18, 2020
@ehuss I don't consider it a regression for the links to link to doc.rlo. The primitive links can be fixed if we want. |
Manishearth
commented
Jul 18, 2020
FWIW in my local build the links do not link to doc.rlo, they link locally. I think what you're seeing is #74458 |
Use intra-doc links in `str` and `BTreeSet` Fixesrust-lang#32129, fixesrust-lang#32130 A _slight_ degradation in quality is that the `#method.foo` links would previously link to the same page on `String`'s documentation, and now they will navigate to `str`. Not a big deal IMO, and we can also try to improve that.
Use intra-doc links in `str` and `BTreeSet` Fixesrust-lang#32129, fixesrust-lang#32130 A _slight_ degradation in quality is that the `#method.foo` links would previously link to the same page on `String`'s documentation, and now they will navigate to `str`. Not a big deal IMO, and we can also try to improve that.
Use intra-doc links in `str` and `BTreeSet` Fixesrust-lang#32129, fixesrust-lang#32130 A _slight_ degradation in quality is that the `#method.foo` links would previously link to the same page on `String`'s documentation, and now they will navigate to `str`. Not a big deal IMO, and we can also try to improve that.
ehuss
commented
Jul 18, 2020
Why not? A fair bit of effort goes into making sure the documentation is usable offline. I also find it confusing when browsing the stable docs, then ending up (without warning) in the nightly docs, using something that appears to be stable, only to learn much later that it is not stable (or doesn't exist at all on stable). To be clear, it is better to fix the broken links on the String page, but I consider it a backstep in other regards that should (eventually) be fixed.
An example is |
Manishearth
commented
Jul 18, 2020
@ehuss That's only on the libcore docs, it's because libcore is weird, yes. We might be able to fix that, I'll file an issue. |
Manishearth
commented
Jul 18, 2020
Shit, closed the PR by mistake |
Manishearth
commented
Jul 18, 2020
Opened as #74453 |
Manishearth
commented
Jul 18, 2020
@ehuss oh, right, this is because primitives only exist in |
jyn514
commented
Jul 18, 2020
That seems weird, shouldn't they be in libcore? |
…arth Rollup of 11 pull requests Successful merges: - rust-lang#72414 ( Add lazy initialization primitives to std) - rust-lang#74069 (Compare tagged/niche-filling layout and pick the best one) - rust-lang#74418 (ci: Set `shell: bash` as a default, remove duplicates) - rust-lang#74441 (bootstrap.py: patch RPATH on NixOS to handle the new zlib dependency.) - rust-lang#74444 (Add regression test for rust-lang#69414) - rust-lang#74448 (improper_ctypes_definitions: allow `Box`) - rust-lang#74449 (Test codegen of compare_exchange operations) - rust-lang#74450 (Fix `Safety` docs for `from_raw_parts_mut`) - rust-lang#74453 (Use intra-doc links in `str` and `BTreeSet`) - rust-lang#74457 (rustbuild: drop tool::should_install) - rust-lang#74464 (Use pathdiff crate) Failed merges: r? @ghost
Fixes#32129, fixes#32130
A slight degradation in quality is that the
#method.foolinks would previously link to the same page onString's documentation, and now they will navigate tostr. Not a big deal IMO, and we can also try to improve that.