-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Default RawOsError to i16 for 16-bit targets
#160543
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| use core::io::RawOsError; | ||
|
|
||
| /// On all targets to date, [`RawOsError`] is equivalent to a `c_int`, with the | ||
| /// notable exception of UEFI, where it is instead defined as `usize`. | ||
| #[test] | ||
| fn raw_os_error_ffi_guarantees() { | ||
| let _: RawOsError = cfg_select! { | ||
| target_os = "uefi" => 0 as usize, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, the test already declare that.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah tgross35's suggestion to use explicitly sized types is compared against the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fwiw I was thinking to put it in a `const _: () = { /* ... */ } so the tests don't actually have to be run (I don't think we run coretests on these 16-bit platforms), but it doesn't matter much
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I'm not a huge fan of that particular |
||
| _ => 0 as core::ffi::c_int, | ||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| mod borrowed_buf; | ||
| mod error; | ||
| mod io_slice; |
Uh oh!
There was an error while loading. Please reload this page.