Skip to content

std: make ExitCode Eq #125182

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from
Closed

std: make ExitCode Eq #125182

wants to merge 1 commit into from

Conversation

djc
Copy link
Contributor

@djc djc commented May 16, 2024

rustup currently has its own utility ExitCode type, which is sometimes converted from std::process::ExitStatus and it would be nice to be able to check whether it represents success.

Not sure if this kind of thing needs to be unstable for a while?

@rustbot
Copy link
Collaborator

rustbot commented May 16, 2024

r? @m-ou-se

rustbot has assigned @m-ou-se.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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 May 16, 2024
@ehuss
Copy link
Contributor

ehuss commented May 16, 2024

There was some discussion about this in various places, such as #93840 (comment), where there was some intent to keep ExitCode somewhat opaque. In particular, exit codes can be integers, but that is one-way (to_i32 was intentionally not stabilized, but supporting Eq would provide a roundabout way of determining the internal code).

There were questions about adding is_success, but I don't see those ever being answered (tracking #48711 and stabilization #93840). However, I could imagine that being a thorny problem.

@jhpratt
Copy link
Member

jhpratt commented May 16, 2024

Not sure if this kind of thing needs to be unstable for a while?

Trait impls cannot currently be unstable, unfortunately.

@djc
Copy link
Contributor Author

djc commented Sep 13, 2024

Closing in favor of #127633.

@djc djc closed this Sep 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants