Skip to content

Tracking Issue for RawOsError #107792

Open
Open
@joboet

Description

@joboet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions