Change Termination::report return type to ExitCode by yaahc · Pull Request #93442 · 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

Conversation15 Commits2 Checks0 Files changed

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

yaahc

Related to #43301

The goal of this change is to minimize the forward compatibility risks in stabilizing Termination. By using the opaque type ExitCode instead of an i32 we leave room for us to evolve the API over time to provide what cross-platform consistency we can / minimize footguns when working with exit codes, where as stabilizing on i32 would limit what changes we could make in the future in how we represent and construct exit codes.

@yaahc

@rust-highfive

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@yaahc yaahc added T-libs-api

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

and removed S-waiting-on-review

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

labels

Jan 28, 2022

scottmcm

@rust-log-analyzer

This comment has been minimized.

@yaahc

Mark-Simulacrum

@Mark-Simulacrum

I will note that without even a PartialEq or is_success/is_failure methods, this makes the ExitCode basically useless outside unstable code modulo passing up to fn main. That seems plausibly OK, but fairly weird for an API we would actually want to stabilize.

r=me with the one nit comment fixed and/or perf run to confirm no effects modulo it.

@bors rollup=never since regardless this'll probably perturb codegen for binaries a little.

@yaahc

@yaahc

Awesome, resolved the inlining issue. Going to add the partial_eq / is_success question to the ExitCode tracking issue as an unresolved question for now.

@bors r=Mark-Simulacrum rollup=never

@bors

📌 Commit 19db85d has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Jan 31, 2022

@yaahc yaahc mentioned this pull request

Jan 31, 2022

1 task

@bors

@bors bors mentioned this pull request

Feb 1, 2022

@bors

@bors bors mentioned this pull request

Feb 1, 2022

@rust-timer

Finished benchmarking commit (2681f25): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@yuhr yuhr mentioned this pull request

Feb 9, 2022

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request

May 19, 2022

@Dylan-DPC

Remove unnecessay .report() on ExitCode

Since rust-lang#93442, the return type is ExitCode anyway so there's no need to do a conversion using .report() (which is now just a no-op).

Labels

merged-by-bors

This PR was explicitly merged by bors.

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-libs-api

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