about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAyush Singh <ayushdevel1325@gmail.com>2023-09-03 12:35:03 +0530
committerAyush Singh <ayushdevel1325@gmail.com>2023-09-03 12:35:03 +0530
commit56df6b81898efcdf4d486eb9baa16e1273f3c08e (patch)
treecf33233ddff39f1464af6ea5f407abb57e89bcf9
parent33e796bbe1eaeadb3146060d7b47b97865582d52 (diff)
downloadrust-56df6b81898efcdf4d486eb9baa16e1273f3c08e.tar.gz
rust-56df6b81898efcdf4d486eb9baa16e1273f3c08e.zip
Move RawOsError defination to sys
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
-rw-r--r--library/std/src/io/error.rs2
-rw-r--r--library/std/src/io/error/repr_bitpacked.rs3
-rw-r--r--library/std/src/sys/mod.rs2
3 files changed, 3 insertions, 4 deletions
diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs
index d6fce4ee78f..ea10bb8636c 100644
--- a/library/std/src/io/error.rs
+++ b/library/std/src/io/error.rs
@@ -102,7 +102,7 @@ enum ErrorData<C> {
 ///
 /// [`into`]: Into::into
 #[unstable(feature = "raw_os_error_ty", issue = "107792")]
-pub type RawOsError = i32;
+pub type RawOsError = sys::RawOsError;
 
 // `#[repr(align(4))]` is probably redundant, it should have that value or
 // higher already. We include it just because repr_bitpacked.rs's encoding
diff --git a/library/std/src/io/error/repr_bitpacked.rs b/library/std/src/io/error/repr_bitpacked.rs
index f94f88bac41..6e7366b3635 100644
--- a/library/std/src/io/error/repr_bitpacked.rs
+++ b/library/std/src/io/error/repr_bitpacked.rs
@@ -374,9 +374,6 @@ static_assert!((TAG_MASK + 1).is_power_of_two());
 static_assert!(align_of::<SimpleMessage>() >= TAG_MASK + 1);
 static_assert!(align_of::<Custom>() >= TAG_MASK + 1);
 
-// `RawOsError` must be an alias for `i32`.
-const _: fn(RawOsError) -> i32 = |os| os;
-
 static_assert!(@usize_eq: TAG_MASK & TAG_SIMPLE_MESSAGE, TAG_SIMPLE_MESSAGE);
 static_assert!(@usize_eq: TAG_MASK & TAG_CUSTOM, TAG_CUSTOM);
 static_assert!(@usize_eq: TAG_MASK & TAG_OS, TAG_OS);
diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs
index beea3f23c2d..63bd783746b 100644
--- a/library/std/src/sys/mod.rs
+++ b/library/std/src/sys/mod.rs
@@ -110,3 +110,5 @@ pub fn log_wrapper<F: Fn(f64) -> f64>(n: f64, log_fn: F) -> f64 {
 pub fn log_wrapper<F: Fn(f64) -> f64>(n: f64, log_fn: F) -> f64 {
     log_fn(n)
 }
+
+pub type RawOsError = i32;