-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Format std::env::consts
docstrings with markdown backticks
#128535
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @workingjubilee (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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.
This is not correct. None of these are actual values in Rust source code, and the backticks are for code, therefore adding the backticks here would also require adding the string quotation marks for each case.
If it is purely for readability's sake then I do not find this to be more readable. |
Sure, will change that. Would it be okay if I add each value it can return to the docs? Or would that list become too long |
It would become far too long for some of these. I think we should only have the "top 5" in the docs, honestly. I would be okay with adding the entire list inside |
This would look vaguely like /// <details><summary>Full List</summary>
///
/// - item
/// - item
///
/// </details> |
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
This clarifies possible outputs the constants might be.
@rustbot review |
library/std/src/env.rs
Outdated
/// <details><summary>Full list of possible values</summary> | ||
/// | ||
/// Some possible values: | ||
/// * `".so"` | ||
/// * `".dylib"` | ||
/// * `".dll"` | ||
/// * `".sgxs"` | ||
/// * `".a"` | ||
/// * `".elf"` | ||
/// * `".wasm"` | ||
/// * `""` (an empty string) | ||
/// | ||
/// - .so | ||
/// - .dylib | ||
/// - .dll | ||
/// </details> |
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.
this one should probably just mention that the list is the same as the list for DLL_EXTENSION
library/std/src/env.rs
Outdated
/// * `"unix"` | ||
/// * `"windows"` | ||
/// * `"itron"` | ||
/// * `""` |
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.
this is missing "wasm", see:
families: cvs!["wasm"], |
which makes me slightly more uncomfortable about accepting this, because I am noticing how easily this will fall out of sync, yet it claims to be a "full list". hrm.
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.
Yes, that is indeed tricky. Maybe I can add a notice that the list might be outdated but that kind of defeats the purpose of the list being there in the first place.
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.
Hmm...
- maybe we could factor out the lists and reinclude them via
#[doc = include_str!("")]
? I think we should prefer to autogenerate such lists and while demanding that of you seems silly, that will be easier to set up later if they are already smaller.md
files. - I think saying "this may be outdated" is useless for the reason you mention, but we could address the temporality of the docs in another way. It could mention that this is the "current full list" inside the
<summary></summary>
tag. Or even say "the compiled list". :^) Or however you might want to phrase that? Even just between versions, the "actual" full list will grow over time, but docs reflect a snapshot in time.
/// - .nexe | ||
/// - .pexe | ||
/// - `""` (an empty string) | ||
/// The possible values are identical to those of [`EXE_EXTENSION`], but with the leading period included. |
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.
/// The possible values are identical to those of [`EXE_EXTENSION`], but with the leading period included. | |
/// The possible values are identical to those of [`EXE_EXTENSION`], but with the leading period included | |
/// if `EXE_EXTENSION` is not `""`. |
library/std/src/env.rs
Outdated
/// * `"unix"` | ||
/// * `"windows"` | ||
/// * `"itron"` | ||
/// * `""` |
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.
Hmm...
- maybe we could factor out the lists and reinclude them via
#[doc = include_str!("")]
? I think we should prefer to autogenerate such lists and while demanding that of you seems silly, that will be easier to set up later if they are already smaller.md
files. - I think saying "this may be outdated" is useless for the reason you mention, but we could address the temporality of the docs in another way. It could mention that this is the "current full list" inside the
<summary></summary>
tag. Or even say "the compiled list". :^) Or however you might want to phrase that? Even just between versions, the "actual" full list will grow over time, but docs reflect a snapshot in time.
Hmm. Better to ship this instead of holding it up further though, imo. Thanks! @bors r+ rollup |
This clarifies possible outputs the constants might be.
Before:
After: