Document From::from
impls by TimTheBig · Pull Request #137330 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
This resolves #51430 by documenting all from
impls in lib std and core.
I still need someone to look over a few of the comments to see if the style is correct.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (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 (S-waiting-on-review
and S-waiting-on-author
) stays updated, invoking these commands when appropriate:
@rustbot author
: the review is finished, PR author should check the comments and take action accordingly@rustbot review
: the author is ready for a review, this PR will be queued again in the reviewer's queue
Operating system: Linux
Operating System: SOLID
Operating system: Unix-like
Operating system: Windows
Status: Awaiting review from the assignee but also interested parties.
Relevant to the library team, which will review and decide on the PR/issue.
labels
The Miri subtree was changed
cc @rust-lang/miri
Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead.
cc @calebzulawski, @programmerjake
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.
cc @rust-lang/rust-analyzer
Some changes occurred in src/tools/clippy
cc @rust-lang/clippy
fmease changed the title
Document from Document From::from
impls
@rustbot label A-docs C-enhancement T-libs-api
Area: Documentation for any part of the project, including the compiler, standard library, and tools
Category: An issue proposing an enhancement or a PR with one.
Relevant to the library API team, which will review and decide on the PR/issue.
labels
Should I move Portable SIMD and rust-analyzer changes even though they are small?
This comment has been minimized.
It is generally a good idea to split up large changes. :) You changed a whole bunch of files in rust-analyzer, so yeah that should be split. Miri and clippy have fewer changes, but the fact that there are any changes at all there still contradicts the PR description.
It's too late now, but the best strategy for PRs like this is to start with just a few files, e.g. just core
, take the review feedback, and then apply that to the next PRs. That avoids having to re-do large amounts of work when there is overarching feedback.
The Miri subtree was changed
cc @rust-lang/miri
Some changes occurred in src/tools/clippy
cc @rust-lang/clippy
Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead.
cc @calebzulawski, @programmerjake
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.
cc @rust-lang/rust-analyzer
My mistake, I will revert the rust-analyzer changes.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
oli-obk left a comment • Loading
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR requires a lot of changes, I did not get far with reviews, but a lot of the doc comments only explain the body in its rawest form. I feel like fully reviewing this just makes the reviewer do the work of documenting things, so it may be easier to just write PRs with documentation.
Also please disclose whether you generated this documentation, even just partially or as an initial thing that you edited.
This comment has been minimized.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments on:
- Obvious/self explanatory conversions. These comments are redundant with the signature of the method.
- Internal/private types. These do not need rustdocs.
- Platform specific code. These do not need rustdocs.
@@ -728,6 +742,7 @@ impl ExitStatus { |
---|
/// Converts a raw `u32` to a type-safe `ExitStatus` by wrapping it without copying. |
impl From for ExitStatus { |
/// Wrap `u32` in a type-safe `ExitStatus` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Wrap `u32` in a type-safe `ExitStatus` |
---|
@@ -777,12 +792,14 @@ impl ExitCode { |
---|
} |
impl From for ExitCode { |
/// Convert the `u8` to a `u32` then wrap it in a `ExitCode` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Convert the `u8` to a `u32` then wrap it in a `ExitCode` |
---|
fn from(code: u8) -> Self { |
---|
ExitCode(u32::from(code)) |
} |
} |
impl From for ExitCode { |
/// Wrap the `u32` in a `ExitCode` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Wrap the `u32` in a `ExitCode` |
---|
@@ -1265,6 +1265,7 @@ mod thread_name_string { |
---|
} |
impl From for ThreadNameString { |
/// Convert `String` to a `CString` then use that as the `ThreadNameString` inner |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Convert `String` to a `CString` then use that as the `ThreadNameString` inner |
---|
Co-authored-by: Sky sky@sky9.dev
@Sky9x Thank you for the suggestions.
Co-authored-by: Sky sky@sky9.dev
@@ -636,6 +645,7 @@ impl From<Rc<[u8]>> for Rc { |
---|
#[unstable(feature = "bstr", issue = "134915")] |
#[cfg(not(no_rc))] |
impl From<Rc> for Rc<[u8]> { |
/// Create a `Rc` from the bytes of `Rc<[u8]>`. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Create a `Rc` from the bytes of `Rc<[u8]>`. |
---|
/// Unwrap the inner bytes of `Rc<ByteStr>`. |
Co-authored-by: Sky sky@sky9.dev
Reviewers
programmerjake programmerjake left review comments
blyxyas blyxyas left review comments
Sky9x Sky9x requested changes
oli-obk Awaiting requested review from oli-obk
workingjubilee Awaiting requested review from workingjubilee
Labels
Area: Documentation for any part of the project, including the compiler, standard library, and tools
Category: An issue proposing an enhancement or a PR with one.
Operating system: Linux
Operating System: SOLID
Operating system: Unix-like
Operating system: Windows
Status: Awaiting review from the assignee but also interested parties.
Relevant to the library team, which will review and decide on the PR/issue.