Skip to content

std::process: fix UEFI ExitStatus::code() silent truncation of error …#153973

Open
devnexen wants to merge 1 commit intorust-lang:mainfrom
devnexen:uefi_code_fix
Open

std::process: fix UEFI ExitStatus::code() silent truncation of error …#153973
devnexen wants to merge 1 commit intorust-lang:mainfrom
devnexen:uefi_code_fix

Conversation

@devnexen
Copy link
Contributor

…codes

UEFI status codes are usize-wide with the high bit set for errors (e.g. DEVICE_ERROR is 0x8000000000000007 on 64-bit). the previous as i32 cast silently dropped the upper bits, losing all error information. stripping the error high bit to extract the error number and negating it, so errors (negative) are distinguishable from success/warning codes (non-negative).

…codes

UEFI status codes are usize-wide with the high bit set for errors
(e.g. DEVICE_ERROR is 0x8000000000000007 on 64-bit). the previous
`as i32` cast silently dropped the upper bits, losing all error
information. stripping the error high bit to extract the error number
and negating it, so errors (negative) are distinguishable from
success/warning codes (non-negative).
@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 Mar 16, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2026

r? @joboet

rustbot has assigned @joboet.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

3 participants