Add must_use lint to ExitCode - #162805
Merged
Merged
Conversation
Collaborator
|
r? @jhpratt rustbot has assigned @jhpratt. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 16, 2026
…jhpratt Add `must_use` lint to `ExitCode` An [`ExitCode`](https://doc.rust-lang.org/nightly/std/process/struct.ExitCode.html) is intended to be returned from `main` (or used in other ways of terminating a process). It's also a `Result` like type in that it has success and error values. It's *probably* a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. with `let _ = ...`).
Member
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #162866 (comment) |
Contributor
|
This pull request was unapproved. This PR was contained in a rollup (#162866), which was unapproved. |
ChrisDenton
force-pushed
the
exit-code-must-use
branch
from
September 16, 2026 22:03
640d68d to
99261fb
Compare
Member
Author
|
@bors try jobs=test-aarch64-gnu-llvm-21-1 |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 16, 2026
Add `must_use` lint to `ExitCode` try-job: test-aarch64-gnu-llvm-21-1
Contributor
Member
Author
|
Just a trivial test change to ignore the returned @bors r=jhpratt |
Contributor
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 17, 2026
…jhpratt Add `must_use` lint to `ExitCode` An [`ExitCode`](https://doc.rust-lang.org/nightly/std/process/struct.ExitCode.html) is intended to be returned from `main` (or used in other ways of terminating a process). It's also a `Result` like type in that it has success and error values. It's *probably* a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. with `let _ = ...`).
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 17, 2026
Rollup of 12 pull requests Successful merges: - #161596 (coretests: Add more pattern tests.) - #162796 (libtest: do not early exit from test runners) - #162844 (Add loan reachability traces to polonius MIR dumps) - #158186 (Guarantee 8 bytes of alignment of RawWakerVTable) - #160108 (Stabilize `windows_process_extensions_main_thread_handle`) - #160212 (traits: Fix rigid alias liveness matching) - #160544 (Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)) - #161305 (Use the entire type of a dropped local to compute variance (edge direction) for Polonius alpha) - #161838 (tests: accept LLVM 24 optimization in this test) - #162805 (Add `must_use` lint to `ExitCode`) - #162825 (core: Add examples for `debug_closure_helpers`) - #162856 (Stabilize CommandExt::show_window)
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 17, 2026
…jhpratt Add `must_use` lint to `ExitCode` An [`ExitCode`](https://doc.rust-lang.org/nightly/std/process/struct.ExitCode.html) is intended to be returned from `main` (or used in other ways of terminating a process). It's also a `Result` like type in that it has success and error values. It's *probably* a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. with `let _ = ...`).
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 17, 2026
…jhpratt Add `must_use` lint to `ExitCode` An [`ExitCode`](https://doc.rust-lang.org/nightly/std/process/struct.ExitCode.html) is intended to be returned from `main` (or used in other ways of terminating a process). It's also a `Result` like type in that it has success and error values. It's *probably* a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. with `let _ = ...`).
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 17, 2026
Rollup of 16 pull requests Successful merges: - #161596 (coretests: Add more pattern tests.) - #162796 (libtest: do not early exit from test runners) - #162844 (Add loan reachability traces to polonius MIR dumps) - #162876 (Move operations out of `rustc_middle::query::job`) - #160108 (Stabilize `windows_process_extensions_main_thread_handle`) - #160212 (traits: Fix rigid alias liveness matching) - #160544 (Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)) - #161246 (Normalize non-rigid aliases in ty_known_to_outlive) - #161305 (Use the entire type of a dropped local to compute variance (edge direction) for Polonius alpha) - #161838 (tests: accept LLVM 24 optimization in this test) - #162805 (Add `must_use` lint to `ExitCode`) - #162825 (core: Add examples for `debug_closure_helpers`) - #162841 (enable asm tests for xtensa targets) - #162842 (reintroduce check RibKind::ConstParamTy did in direct consts) - #162845 (mgca: fix issue with mismatched array valtree/valtree tys) - #162856 (Stabilize CommandExt::show_window)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 17, 2026
…jhpratt Add `must_use` lint to `ExitCode` An [`ExitCode`](https://doc.rust-lang.org/nightly/std/process/struct.ExitCode.html) is intended to be returned from `main` (or used in other ways of terminating a process). It's also a `Result` like type in that it has success and error values. It's *probably* a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. with `let _ = ...`).
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 17, 2026
…uwer Rollup of 24 pull requests Successful merges: - #161596 (coretests: Add more pattern tests.) - #162177 (Properly implement the gpu-kernel ABI for amdgpu) - #162411 (Make Receiver `#[rustc_dyn_incompatible_trait]`) - #162760 (yeet alias new_from_def_id) - #162796 (libtest: do not early exit from test runners) - #162844 (Add loan reachability traces to polonius MIR dumps) - #162876 (Move operations out of `rustc_middle::query::job`) - #160108 (Stabilize `windows_process_extensions_main_thread_handle`) - #160212 (traits: Fix rigid alias liveness matching) - #160544 (Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)) - #161305 (Use the entire type of a dropped local to compute variance (edge direction) for Polonius alpha) - #161838 (tests: accept LLVM 24 optimization in this test) - #162312 (core: Rewrite docs for try_as_dyn) - #162785 (Avoid creating overlapping assignments in MatchBranchSimplification) - #162805 (Add `must_use` lint to `ExitCode`) - #162825 (core: Add examples for `debug_closure_helpers`) - #162841 (enable asm tests for xtensa targets) - #162842 (reintroduce check RibKind::ConstParamTy did in direct consts) - #162845 (mgca: fix issue with mismatched array valtree/valtree tys) - #162856 (Stabilize CommandExt::show_window) - #162865 (Complex conjugate, negation and default) - #162874 (Add support for `annotate_snippets::snippet::AnnotationKind::Visible`) - #162881 (Simplify the macro for forwarding Decoder methods ) - #162888 (Fix a typo on the Armv7-R platform docs page)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 17, 2026
…uwer Rollup of 23 pull requests Successful merges: - #161596 (coretests: Add more pattern tests.) - #162411 (Make Receiver `#[rustc_dyn_incompatible_trait]`) - #162760 (yeet alias new_from_def_id) - #162796 (libtest: do not early exit from test runners) - #162844 (Add loan reachability traces to polonius MIR dumps) - #162876 (Move operations out of `rustc_middle::query::job`) - #160108 (Stabilize `windows_process_extensions_main_thread_handle`) - #160212 (traits: Fix rigid alias liveness matching) - #160544 (Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)) - #161305 (Use the entire type of a dropped local to compute variance (edge direction) for Polonius alpha) - #161838 (tests: accept LLVM 24 optimization in this test) - #162312 (core: Rewrite docs for try_as_dyn) - #162785 (Avoid creating overlapping assignments in MatchBranchSimplification) - #162805 (Add `must_use` lint to `ExitCode`) - #162825 (core: Add examples for `debug_closure_helpers`) - #162841 (enable asm tests for xtensa targets) - #162842 (reintroduce check RibKind::ConstParamTy did in direct consts) - #162845 (mgca: fix issue with mismatched array valtree/valtree tys) - #162856 (Stabilize CommandExt::show_window) - #162865 (Complex conjugate, negation and default) - #162874 (Add support for `annotate_snippets::snippet::AnnotationKind::Visible`) - #162881 (Simplify the macro for forwarding Decoder methods ) - #162888 (Fix a typo on the Armv7-R platform docs page)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 17, 2026
Rollup merge of #162805 - ChrisDenton:exit-code-must-use, r=jhpratt Add `must_use` lint to `ExitCode` An [`ExitCode`](https://doc.rust-lang.org/nightly/std/process/struct.ExitCode.html) is intended to be returned from `main` (or used in other ways of terminating a process). It's also a `Result` like type in that it has success and error values. It's *probably* a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. with `let _ = ...`).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An
ExitCodeis intended to be returned frommain(or used in other ways of terminating a process). It's also aResultlike type in that it has success and error values. It's probably a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. withlet _ = ...).