Auto merge of #115493 - Ayush1325:raw-os-error, r=workingjubilee

Move RawOsError defination to sys

This was originally a part of https://github.com/rust-lang/rust/pull/105861, but I feel it should be its own PR since the raw os error is still unstable.
This commit is contained in:
bors 2023-09-04 08:04:00 +00:00
commit ce798a52c3
3 changed files with 3 additions and 4 deletions

View File

@ -102,7 +102,7 @@ enum ErrorData<C> {
/// ///
/// [`into`]: Into::into /// [`into`]: Into::into
#[unstable(feature = "raw_os_error_ty", issue = "107792")] #[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 // `#[repr(align(4))]` is probably redundant, it should have that value or
// higher already. We include it just because repr_bitpacked.rs's encoding // higher already. We include it just because repr_bitpacked.rs's encoding

View File

@ -374,9 +374,6 @@ macro_rules! static_assert {
static_assert!(align_of::<SimpleMessage>() >= TAG_MASK + 1); static_assert!(align_of::<SimpleMessage>() >= TAG_MASK + 1);
static_assert!(align_of::<Custom>() >= 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_SIMPLE_MESSAGE, TAG_SIMPLE_MESSAGE);
static_assert!(@usize_eq: TAG_MASK & TAG_CUSTOM, TAG_CUSTOM); static_assert!(@usize_eq: TAG_MASK & TAG_CUSTOM, TAG_CUSTOM);
static_assert!(@usize_eq: TAG_MASK & TAG_OS, TAG_OS); static_assert!(@usize_eq: TAG_MASK & TAG_OS, TAG_OS);

View File

@ -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 { pub fn log_wrapper<F: Fn(f64) -> f64>(n: f64, log_fn: F) -> f64 {
log_fn(n) log_fn(n)
} }
pub type RawOsError = i32;