Skip to content
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

Tracking Issue for RawOsError #107792

Open
2 of 4 tasks
joboet opened this issue Feb 8, 2023 · 1 comment
Open
2 of 4 tasks

Tracking Issue for RawOsError #107792

joboet opened this issue Feb 8, 2023 · 1 comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@joboet
Copy link
Member

joboet commented Feb 8, 2023

Feature gate: #![feature(raw_os_error_ty)]

This is a tracking issue for the raw OS error type alias, used in io::Error::raw_os_error and io::Error::from_raw_os_error (both are stable APIs).

std used to assume that the OS error type (return by errno and such) is an i32. This is however not the case on platforms like UEFI (which uses usize). To ensure idiomatic and convenient handling of native errors without loosing information, the RawOsError type is introduced to allow future ports of the standard library to use the correct error type for their respective platform. As this does not change the error type on already supported targets, this is a backwards-compatible change. Current software can still use i32 directly while the RawOsError type alias is unstable. However, this feature should probably be stabilized before ports using a different type are merged, to allow software to be more easily ported.

Public API

// std::io

pub type RawOsError = /* platform error type, `i32` most of the time */;

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@joboet joboet added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Feb 8, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Feb 8, 2023
…=Dylan-DPC

Add missing tracking issue for `RawOsError`

I forgot to add it in the original PR…

See rust-lang#107792.

`@rustbot` label +T-libs-api -T-libs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 8, 2023
…=Dylan-DPC

Add missing tracking issue for `RawOsError`

I forgot to add it in the original PR…

See rust-lang#107792.

``@rustbot`` label +T-libs-api -T-libs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 8, 2023
…=Dylan-DPC

Add missing tracking issue for `RawOsError`

I forgot to add it in the original PR…

See rust-lang#107792.

```@rustbot``` label +T-libs-api -T-libs
@GuillaumeGomez
Copy link
Member

Just commenting on this to say that the Error::raw_os_error is stable whereas the type alias (returned by this function) isn't, which doesn't make much sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants