Skip to content

Commit aa73de4

Browse files
committed
std: move RawOsError to sys::io
1 parent 693f365 commit aa73de4

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

library/std/src/io/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ enum ErrorData<C> {
139139
///
140140
/// [`into`]: Into::into
141141
#[unstable(feature = "raw_os_error_ty", issue = "107792")]
142-
pub type RawOsError = sys::RawOsError;
142+
pub type RawOsError = sys::io::RawOsError;
143143

144144
// `#[repr(align(4))]` is probably redundant, it should have that value or
145145
// higher already. We include it just because repr_bitpacked.rs's encoding

library/std/src/sys/io/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@ pub use kernel_copy::{CopyState, kernel_copy};
5555
// Bare metal platforms usually have very small amounts of RAM
5656
// (in the order of hundreds of KB)
5757
pub const DEFAULT_BUF_SIZE: usize = if cfg!(target_os = "espidf") { 512 } else { 8 * 1024 };
58+
59+
pub type RawOsError = cfg_select! {
60+
target_os = "uefi" => usize,
61+
_ => i32,
62+
};

library/std/src/sys/pal/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,3 @@ pub const FULL_BACKTRACE_DEFAULT: bool = cfg_select! {
9292
target_os = "fuchsia" => true,
9393
_ => false,
9494
};
95-
96-
#[cfg(not(target_os = "uefi"))]
97-
pub type RawOsError = i32;

library/std/src/sys/pal/uefi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
//! [`OsString`]: crate::ffi::OsString
1414
#![forbid(unsafe_op_in_unsafe_fn)]
1515

16+
use crate::io::RawOsError;
17+
1618
pub mod helpers;
1719
pub mod os;
1820
pub mod time;
1921

2022
#[cfg(test)]
2123
mod tests;
2224

23-
pub type RawOsError = usize;
24-
2525
use crate::io as std_io;
2626
use crate::os::uefi;
2727
use crate::ptr::NonNull;

0 commit comments

Comments
 (0)