-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for intra-doc links in libstd #75080
Comments
Hi @jyn514, I would like to work on the following files:
|
Go for it! |
Many of these links can be brute force replaced using a regex, for items such as |
Method links and others (207) can be caught with |
Intrinsics furthermore has a lot (~80) of special ones which match |
Go ahead and try the regex approach, if there are conflcits we can try and resolve them. |
I ran all replacements, then ran |
I'm not sure which ones you think will be broken. |
Associated items anywhere other than documenting the associated item itself (#74489) |
You can check by manually introducing a broken link and see if it's caught. If so, the tests are working :) I recommend |
Hi @RDambrosio016, could you do that for time.rs cmp.rs and borrow.rs as well? It's great to have a more automated variant. |
@denisvasilik not quite sure what you mean by do it for those files, as far as i can see all of the replacements in those files work. I identified another pattern of |
I had troubles with files located under |
Yeah a fair amount of these replacement may be broken, but the goal of this is to overall reduce the amount of changes needed to be done. |
Here's another regex slightly modified to match
Regex: |
I saw that I cannot reference
If I add |
Use [`ops`]: crate::ops Intra-doc links follow (almost) exactly the same rules as normal name resolution. |
Thank you for the detailed explanation. I would like to work on:
|
I'll take |
Hello ! I wrote a Python (3.6+, tested with 3.7 and 3.8) script to help with this issue, here is the gist. By default it will not modify the files you pass it, only showing what it would do. You can find more informations about it in the documentation of the script. Feel free to use it to speed up the work but be aware it is not perfect and you still review the whole file as well as any changes it makes. It may miss lines or modify some that shouldn't be modified. It is not aware of The script should preserve indentation perfectly if nothing else so you shouldn't have to rerun I attached an example of the output produced by the script, please check yours is similar before applying its proposed changes: |
…, r=jyn514 Move to intra-doc links in library/std/src/path.rs Helps with rust-lang#75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc Known issue: The following links are broken (they are inside trait impls, undocumented in this file, inheriting from the original doc): - [`Hasher`] - [`Self`] (referencing `../primitive.slice.html`) - [`Ordering`]
…jyn514 Finish moving to intra doc links for std::sync Helps with rust-lang#75080. @rustbot modify labels: T-doc A-intra-doc-links r? @jyn514
…=jyn514 Use intra-doc links in core/src/iter when possible Helps with rust-lang#75080. I also updated lots of links to use `fn()` instead of `fn` when possible. @rustbot modify labels: T-doc A-intra-doc-links r? @jyn514
…jyn514 Finish moving to intra doc links for std::sync Helps with rust-lang#75080. @rustbot modify labels: T-doc A-intra-doc-links r? @jyn514
…=jyn514 Use intra-doc links in core/src/iter when possible Helps with rust-lang#75080. I also updated lots of links to use `fn()` instead of `fn` when possible. @rustbot modify labels: T-doc A-intra-doc-links r? @jyn514
…jyn514 Finish moving to intra doc links for std::sync Helps with rust-lang#75080. @rustbot modify labels: T-doc A-intra-doc-links r? @jyn514
What's the status of this? |
Blocked on #75809 (well, it's not technically blocked but I don't want to mess with |
#75701 has been closed for inactivity, can we work on it now or is there another PR for it ? |
Sure, if you want to work on it go ahead. |
Will do ! |
Are any of the "Unclaimed" things here actually unclaimed? I can't find anything with |
@pitaj yes
It's a little misleading because I said what they should be in some cases, not what they are. But there are still links that need to be fixed. |
Ah I see! Thanks for clearing that up. |
I'll claim std::io::buffered and core::intrinsics
|
Use Intra-doc links for std::io::buffered Helps with rust-lang#75080. I used the implicit link style for intrinsics, as that was what `minnumf32` and others already had. `@rustbot` modify labels: T-doc, A-intra-doc-links r? `@jyn514`
Use Intra-doc links for std::io::buffered Helps with rust-lang#75080. I used the implicit link style for intrinsics, as that was what `minnumf32` and others already had. ``@rustbot`` modify labels: T-doc, A-intra-doc-links r? ``@jyn514``
…jyn514 More intra doc links Helps with rust-lang#75080. I did a commit by group of file, I can squash if wanted. `@rustbot` modify labels: T-doc, A-intra-doc-links r? `@jyn514`
|
Convert core/num/mod.rs to intra-doc links Helps with rust-lang#75080. This can't convert the associated constants `MAX` and `MIN` until rust-lang#74489 is merged. r? `@poliorcetics`
I can't find any old-style links in in (And is whatever remains to be done still |
I think there are few enough links left to convert it's not useful to have a tracking issue for them. |
This is a tracking issue for switching libstd to intra-doc links (rust-lang/rfcs#1946, #74430 (comment)).
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Mentoring instructions (or rather, suggested workflow)
Please first leave a comment here stating that you want to work on file xxx.rs or module xxx, to make sure that this implements
Sync
.rewrite it as
In most cases, the type will already be in scope, in which case you can remove the reference link altogether.
For an example PR, see #74470.
x.py doc library/std
. This shouldwarn(broken_intra_doc_links)
by default../x.py tidy
, which will runrustfmt
.In case of rustdoc bugs, there may be broken links that didn't show up when you ran
x.py doc
. However, these will be caught by the test suite, so you don't have to check them locally.Suggested tools
core
andstd
: Tracking Issue for intra-doc links in libstd #75080 (comment)Caveats
Primitives that have the same name as a module in scope must useThis was changed in #75318,type@
to disambiguate them. For example, to link tochar
from std, usetype@char
.char
will now link to the primitive, not the module.The following cannot use intra-doc links. If you run into an issue with them, it's ok to skip them. However, if you see an issue not mentioned here, please file a bug report!
core
tostd
(Figure out a way to link to downstream crates #74481)--stage 0
, so you may not be able to make changes that require recently merged fixes: Move to doc links inside the prelude #75368 (comment)Associated items anywhere other than documenting the associated item itself (Fix intra-doc links for associated items #74489)FixedLinks on default function implementations for a trait (Intra-doc links are not resolved in inherited docs from upstream traits #73829). Note that these will not warn if they fail to resolve, so you should be careful about modifying links on traits.FixedTODO list
This list was generated with
rg '\[.*\]: \.\./.*' library/ -l | sed 's/^/- [ ] /'
and may not be complete. If you see other links not mentioned here, feel free to fix them as well.Since most files only have a few links, it's fine to claim multiple files at the same time.
Unclaimed
[std::convert::identity]: crate::convert::identity
(Move to intra-doc links for /library/core/src/hint.rs #75423 (comment))[i32::MAX]
(Fix intra-doc links for associated constants on primitives #76093)[crate::ptr]
in libcore (intra-doc links:crate::ptr
on a re-export of core::slice is not resolved in alloc #76106)[TcpStream::read]: Read::read
(Move to intra doc links for std::io #75674)In-progress
[flush]: Write::flush
(https://github.com/rust-lang/rust/pull/75674/files#diff-1eb455549b75a568d81f2f6a8a7020c0R446, claimed by @pitaj in Tracking Issue for intra-doc links in libstd #75080 (comment))Completed
Cannot be fixed
The following links cannot yet be fixed due to limitations in rustdoc.
[Vec::get_mut]
(Move to intra-doc links for task.rs and vec.rs #75672 (comment))The text was updated successfully, but these errors were encountered: