-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking Issue for ExitCodeExt on Windows #111688
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(windows_process_exit_code_from)]This is a tracking issue for implementing additional
ExitCodes for Windows.Motivation
On Windows it is common for applications to return
HRESULT(i32) orDWORD(u32) values. These stem from COM based components (HRESULTS), Win32 errors (GetLastError), GUI applications (WM_QUIT) and more. The newly stabilizedExitCodeprovides an excellent fit for propagating these values, becausestd::process::exitdoes not run deconstructors which can result in errors. However,ExitCodecurrently only implementsFrom<u8> for ExitCode, which disallows the full range ofi32/u32values. This pull requests attempts to address that shortcoming by providing windows specific extensions that accept au32value (which covers all possibleHRESULTSand Win32 errors) analog to ExitStatusExt::from_raw.This was also intended by the original Stabilization #93840 (comment) as pointed out by @eggyal in #97914 (comment):
[Emphasis added]
Public API
Steps / History
Unresolved Questions
Additional Links
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩