Skip to content

Commit ce798a5

Browse files
committed
Auto merge of rust-lang#115493 - Ayush1325:raw-os-error, r=workingjubilee
Move RawOsError defination to sys This was originally a part of rust-lang#105861, but I feel it should be its own PR since the raw os error is still unstable.
2 parents b14b074 + 56df6b8 commit ce798a5

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

library/std/src/io/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ enum ErrorData<C> {
102102
///
103103
/// [`into`]: Into::into
104104
#[unstable(feature = "raw_os_error_ty", issue = "107792")]
105-
pub type RawOsError = i32;
105+
pub type RawOsError = sys::RawOsError;
106106

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

library/std/src/io/error/repr_bitpacked.rs

-3
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,6 @@ static_assert!((TAG_MASK + 1).is_power_of_two());
374374
static_assert!(align_of::<SimpleMessage>() >= TAG_MASK + 1);
375375
static_assert!(align_of::<Custom>() >= TAG_MASK + 1);
376376

377-
// `RawOsError` must be an alias for `i32`.
378-
const _: fn(RawOsError) -> i32 = |os| os;
379-
380377
static_assert!(@usize_eq: TAG_MASK & TAG_SIMPLE_MESSAGE, TAG_SIMPLE_MESSAGE);
381378
static_assert!(@usize_eq: TAG_MASK & TAG_CUSTOM, TAG_CUSTOM);
382379
static_assert!(@usize_eq: TAG_MASK & TAG_OS, TAG_OS);

library/std/src/sys/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ pub fn log_wrapper<F: Fn(f64) -> f64>(n: f64, log_fn: F) -> f64 {
110110
pub fn log_wrapper<F: Fn(f64) -> f64>(n: f64, log_fn: F) -> f64 {
111111
log_fn(n)
112112
}
113+
114+
pub type RawOsError = i32;

0 commit comments

Comments
 (0)