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 }})

TimTheBig

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.

@rustbot

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 rustbot added O-linux

Operating system: Linux

O-solid

Operating System: SOLID

O-unix

Operating system: Unix-like

O-windows

Operating system: Windows

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

Feb 20, 2025

@rustbot

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 fmease changed the titleDocument from Document From::from impls

Feb 20, 2025

@TimTheBig

@rustbot label A-docs C-enhancement T-libs-api

@rustbot rustbot added A-docs

Area: Documentation for any part of the project, including the compiler, standard library, and tools

C-enhancement

Category: An issue proposing an enhancement or a PR with one.

T-libs-api

Relevant to the library API team, which will review and decide on the PR/issue.

labels

Feb 20, 2025

@TimTheBig

Should I move Portable SIMD and rust-analyzer changes even though they are small?

@rust-log-analyzer

This comment has been minimized.

@RalfJung

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.

@rustbot

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

@TimTheBig

My mistake, I will revert the rust-analyzer changes.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

oli-obk

Contributor

@oli-obk 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.

@rust-log-analyzer

This comment has been minimized.

TimTheBig

@TimTheBig

TimTheBig

TimTheBig

TimTheBig

TimTheBig

@TimTheBig

Sky9x

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comments on:

@@ -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

Sky9x

TimTheBig

TimTheBig

TimTheBig

@TimTheBig @Sky9x

Co-authored-by: Sky sky@sky9.dev

@TimTheBig

@Sky9x Thank you for the suggestions.

TimTheBig

@TimTheBig @Sky9x

Co-authored-by: Sky sky@sky9.dev

TimTheBig

TimTheBig

@@ -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>`.

TimTheBig

TimTheBig

TimTheBig

TimTheBig

TimTheBig

TimTheBig

TimTheBig

TimTheBig

TimTheBig

@TimTheBig @Sky9x

Co-authored-by: Sky sky@sky9.dev

Reviewers

@programmerjake programmerjake programmerjake left review comments

@blyxyas blyxyas blyxyas left review comments

@Sky9x Sky9x Sky9x requested changes

@oli-obk oli-obk Awaiting requested review from oli-obk

@workingjubilee workingjubilee Awaiting requested review from workingjubilee

Labels

A-docs

Area: Documentation for any part of the project, including the compiler, standard library, and tools

C-enhancement

Category: An issue proposing an enhancement or a PR with one.

O-linux

Operating system: Linux

O-solid

Operating System: SOLID

O-unix

Operating system: Unix-like

O-windows

Operating system: Windows

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.