From 765f6a44e67347e3e2e396a9631c3909663745f3 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Fri, 4 Oct 2024 16:36:15 +0200 Subject: [PATCH] remove compile error + make better for rust-analyzer --- .../objc2/src/__macro_helpers/os_version.rs | 124 ++++++++----- .../src/__macro_helpers/os_version/apple.rs | 11 +- crates/objc2/src/macros/available.rs | 167 ++++-------------- .../test_available/expected/apple-aarch64.s | 20 ++- .../test_available/expected/apple-armv7s.s | 28 ++- .../test_available/expected/apple-x86.s | 32 +++- .../test_available/expected/apple-x86_64.s | 26 ++- .../test_available/expected/gnustep-x86.s | 28 ++- .../test_available/expected/gnustep-x86_64.s | 28 ++- .../crates/test_available/lib.rs | 12 ++ crates/test-ui/ui/available_invalid.stderr | 27 ++- .../ui/available_missing_current_os.rs | 10 -- .../ui/available_missing_current_os.stderr | 7 - 13 files changed, 262 insertions(+), 258 deletions(-) delete mode 100644 crates/test-ui/ui/available_missing_current_os.rs delete mode 100644 crates/test-ui/ui/available_missing_current_os.stderr diff --git a/crates/objc2/src/__macro_helpers/os_version.rs b/crates/objc2/src/__macro_helpers/os_version.rs index 054d5d313..713f2f128 100644 --- a/crates/objc2/src/__macro_helpers/os_version.rs +++ b/crates/objc2/src/__macro_helpers/os_version.rs @@ -66,6 +66,18 @@ const fn parse_usize(mut bytes: &[u8]) -> (usize, &[u8]) { } impl OSVersion { + const MIN: Self = Self { + major: 0, + minor: 0, + patch: 0, + }; + + const MAX: Self = Self { + major: u16::MAX, + minor: u8::MAX, + patch: u8::MAX, + }; + /// Parse the version from a string at `const` time. #[track_caller] pub const fn from_str(version: &str) -> Self { @@ -175,72 +187,75 @@ impl fmt::Debug for OSVersion { /// with a compile error if the code ends up being compiled for that platform. #[derive(Clone, Copy, Debug)] pub struct AvailableVersion { - #[cfg(target_os = "macos")] pub macos: OSVersion, - #[cfg(target_os = "ios")] pub ios: OSVersion, - #[cfg(target_os = "tvos")] pub tvos: OSVersion, - #[cfg(target_os = "watchos")] pub watchos: OSVersion, - #[cfg(target_os = "visionos")] pub visionos: OSVersion, + #[doc(hidden)] + pub __others: OSVersion, } impl AvailableVersion { - pub const DOTDOT_FALLBACK: Self = { - // A version of 0.0.0 will always be lower than the deployment target, - // and hence will always return `true` from `is_available`. - let _version = OSVersion { - major: 0, - minor: 0, - patch: 0, - }; - Self { - #[cfg(target_os = "macos")] - macos: _version, - #[cfg(target_os = "ios")] - ios: _version, - #[cfg(target_os = "tvos")] - tvos: _version, - #[cfg(target_os = "watchos")] - watchos: _version, - #[cfg(target_os = "visionos")] - visionos: _version, - } + pub const MIN: Self = Self { + macos: OSVersion::MIN, + ios: OSVersion::MIN, + tvos: OSVersion::MIN, + watchos: OSVersion::MIN, + visionos: OSVersion::MIN, + __others: OSVersion::MIN, }; -} -#[inline] -#[cfg(not(target_vendor = "apple"))] -pub fn is_available(_version: AvailableVersion) -> bool { - // Assume that things are always available on GNUStep etc. - true + pub const MAX: Self = Self { + macos: OSVersion::MAX, + ios: OSVersion::MAX, + tvos: OSVersion::MAX, + watchos: OSVersion::MAX, + visionos: OSVersion::MAX, + __others: OSVersion::MAX, + }; } #[inline] -#[cfg(target_vendor = "apple")] pub fn is_available(version: AvailableVersion) -> bool { - #[cfg(target_os = "macos")] - let version = version.macos; - #[cfg(target_os = "ios")] - let version = version.ios; - #[cfg(target_os = "tvos")] - let version = version.tvos; - #[cfg(target_os = "watchos")] - let version = version.watchos; - #[cfg(target_os = "visionos")] - let version = version.visionos; - - // If the deployment target is high enough, the API is always available. + let version = if cfg!(target_os = "macos") { + version.macos + } else if cfg!(target_os = "ios") { + version.ios + } else if cfg!(target_os = "tvos") { + version.tvos + } else if cfg!(target_os = "watchos") { + version.watchos + } else if cfg!(target_os = "visionos") { + version.visionos + } else { + version.__others + }; + + // In the special case that `version` was set to `OSVersion::MAX`, we + // assume that there can never be an OS version that large, and hence we + // want to avoid checking at all. // - // This check should be optimized away at compile time. - if version <= apple::DEPLOYMENT_TARGET { - return true; + // This is useful for platforms where the version hasn't been specified. + if version == OSVersion::MAX { + return false; } - // Otherwise, compare against the version at runtime. - version <= apple::current_version() + #[cfg(target_vendor = "apple")] + { + // If the deployment target is high enough, the API is always available. + // + // This check should be optimized away at compile time. + if version <= apple::DEPLOYMENT_TARGET { + return true; + } + + // Otherwise, compare against the version at runtime. + version <= apple::current_version() + } + + #[cfg(not(target_vendor = "apple"))] + return true; } #[cfg(test)] @@ -361,6 +376,9 @@ mod tests { // Always available assert!(available!(..)); + // Never available + assert!(!available!()); + // Low versions, always available assert!(available!( macos = 10.0, @@ -379,5 +397,13 @@ mod tests { watchos = 99, visionos = 99 )); + + if !cfg!(target_os = "tvos") { + // Available nowhere except tvOS + assert!(!available!(tvos = 1.2)); + + // Available everywhere, except low tvOS versions + assert!(available!(tvos = 1.2, ..)); + } } } diff --git a/crates/objc2/src/__macro_helpers/os_version/apple.rs b/crates/objc2/src/__macro_helpers/os_version/apple.rs index 3a26d8545..06ebebcea 100644 --- a/crates/objc2/src/__macro_helpers/os_version/apple.rs +++ b/crates/objc2/src/__macro_helpers/os_version/apple.rs @@ -262,15 +262,8 @@ mod tests { #[test] fn read_version() { - assert!( - current_version() - > OSVersion { - major: 0, - minor: 0, - patch: 0, - }, - "version cannot be 0.0.0" - ); + assert!(OSVersion::MIN < current_version(), "version cannot be min"); + assert!(current_version() < OSVersion::MAX, "version cannot be max"); } #[test] diff --git a/crates/objc2/src/macros/available.rs b/crates/objc2/src/macros/available.rs index fc1769166..921d4ec09 100644 --- a/crates/objc2/src/macros/available.rs +++ b/crates/objc2/src/macros/available.rs @@ -10,159 +10,52 @@ #[doc(alias = "#available")] // Swift #[macro_export] macro_rules! available { - ( - $( - $os:ident = $major:literal $(. $minor:literal $(. $patch:literal)?)? - ),+ - $(,)? - ) => { - $crate::__available_fields!( - () - $( - ($os, $os, $crate::__available_version!($major $(. $minor $(. $patch)?)?)) - )* - ) - }; ( // Doesn't actually parse versions this way (see __available_version), // but is helpful to write it like this for documentation. $( - $os:ident = $major:literal $(. $minor:literal $(. $patch:literal)?)?, - )* - // Allow missing versions when `..` is specified, by spreading - // `AvailableVersion::DOTDOT_FALLBACK` in that case. - .. - ) => { - $crate::__available_fields!( - () - $( - ($os, $os, $crate::__available_version!($major $(. $minor $(. $patch)?)?)) - )* - .. - ) - }; -} - -/// tt-muncher, we need to handle each OS name manually, since `target_os` -/// only supports fixed literals (we can't do `target_os = stringify!($os)`). -#[doc(hidden)] -#[macro_export] -macro_rules! __available_fields { - // Base case - ( - ($($output:tt)*) + // Use optionality for the version here, to allow rust-analyzer to + // work with partially filled macros. + $os:ident $(= $major:literal $(. $minor:literal $(. $patch:literal)?)?)? + ),* + $(,)? ) => { $crate::__macro_helpers::is_available({ // TODO: Use inline const once in MSRV #[allow(clippy::needless_update)] const VERSION: $crate::__macro_helpers::AvailableVersion = $crate::__macro_helpers::AvailableVersion { - $($output)* + $( + $os: $($crate::__available_version!($major $(. $minor $(. $patch)?)?))?, + )* + // A version this high will never be lower than the deployment + // target, and hence will always return `false` from + // `is_available`. + .. $crate::__macro_helpers::AvailableVersion::MAX }; VERSION }) }; - // macOS - ( - ($($output:tt)*) - (macos, $os:ident, $version:expr) - $($rest:tt)* - ) => { - $crate::__available_fields!( - ( - $($output)* - #[cfg(target_os = "macos")] - $os: $version, - ) - $($rest)* - ) - }; - // iOS - ( - ($($output:tt)*) - (ios, $os:ident, $version:expr) - $($rest:tt)* - ) => { - $crate::__available_fields!( - ( - $($output)* - #[cfg(target_os = "ios")] - $os: $version, - ) - $($rest)* - ) - }; - // tvOS ( - ($($output:tt)*) - (tvos, $os:ident, $version:expr) - $($rest:tt)* - ) => { - $crate::__available_fields!( - ( - $($output)* - #[cfg(target_os = "tvos")] - $os: $version, - ) - $($rest)* - ) - }; - // watchOS - ( - ($($output:tt)*) - (watchos, $os:ident, $version:expr) - $($rest:tt)* - ) => { - $crate::__available_fields!( - ( - $($output)* - #[cfg(target_os = "watchos")] - $os: $version, - ) - $($rest)* - ) - }; - // visionOS - ( - ($($output:tt)*) - (visionos, $os:ident, $version:expr) - $($rest:tt)* - ) => { - $crate::__available_fields!( - ( - $($output)* - #[cfg(target_os = "visionos")] - $os: $version, - ) - $($rest)* - ) - }; - // Unknown OS - ( - ($($output:tt)*) - ($unknown_os:ident, $os:ident, $version:expr) - $($rest:tt)* - ) => { - $crate::__available_fields!( - ( - $($output)* - // It's fine to output the version for unknown OS-es here, - // since `AvailableVersion` is going to catch the mistake. - $os: $version, - ) - $($rest)* - ) - }; - // .. marker. - ( - ($($output:tt)*) + $( + $os:ident $(= $major:literal $(. $minor:literal $(. $patch:literal)?)?)?, + )* .. ) => { - $crate::__available_fields!( - ( - $($output)* - .. $crate::__macro_helpers::AvailableVersion::DOTDOT_FALLBACK - ) - ) + $crate::__macro_helpers::is_available({ + #[allow(clippy::needless_update)] + const VERSION: $crate::__macro_helpers::AvailableVersion = $crate::__macro_helpers::AvailableVersion { + $( + $os: $($crate::__available_version!($major $(. $minor $(. $patch)?)?))?, + )* + // A version of 0.0.0 will always be lower than the deployment + // target, and hence will always return `true` from + // `is_available`. + // + // We do this when `..` is specified. + .. $crate::__macro_helpers::AvailableVersion::MIN + }; + VERSION + }) }; } diff --git a/crates/test-assembly/crates/test_available/expected/apple-aarch64.s b/crates/test-assembly/crates/test_available/expected/apple-aarch64.s index 21b56a440..380bf45c4 100644 --- a/crates/test-assembly/crates/test_available/expected/apple-aarch64.s +++ b/crates/test-assembly/crates/test_available/expected/apple-aarch64.s @@ -100,6 +100,12 @@ _always: mov w0, #1 ret + .globl _never + .p2align 2 +_never: + mov w0, #0 + ret + .globl _low .p2align 2 _low: @@ -118,19 +124,25 @@ Lloh11: ldr x19, [x19, SYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)@GOTPAGEOFF] ldapr x8, [x19] cmp x8, #3 - b.ne LBB5_2 -LBB5_1: + b.ne LBB6_2 +LBB6_1: ldrh w8, [x19, #10] cmp w8, #14 cset w0, hi ldp x29, x30, [sp, #16] ldp x20, x19, [sp], #32 ret -LBB5_2: +LBB6_2: bl SYM(>::initialize::<>::get_or_init::{closure#0}, !>, 0) - b LBB5_1 + b LBB6_1 .loh AdrpLdrGot Lloh10, Lloh11 + .globl _only_ios + .p2align 2 +_only_ios: + mov w0, #0 + ret + .section __DATA,__const .p2align 3, 0x0 l_anon.[ID].0: diff --git a/crates/test-assembly/crates/test_available/expected/apple-armv7s.s b/crates/test-assembly/crates/test_available/expected/apple-armv7s.s index 63875825e..ef7189072 100644 --- a/crates/test-assembly/crates/test_available/expected/apple-armv7s.s +++ b/crates/test-assembly/crates/test_available/expected/apple-armv7s.s @@ -117,6 +117,13 @@ _always: mov r0, #1 bx lr + .globl _never + .p2align 2 + .code 32 +_never: + mov r0, #0 + bx lr + .globl _low .p2align 2 .code 32 @@ -130,23 +137,30 @@ _low: _high: push {r4, r7, lr} add r7, sp, #4 - movw r4, :lower16:(LSYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)$non_lazy_ptr-(LPC5_0+8)) - movt r4, :upper16:(LSYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)$non_lazy_ptr-(LPC5_0+8)) -LPC5_0: + movw r4, :lower16:(LSYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)$non_lazy_ptr-(LPC6_0+8)) + movt r4, :upper16:(LSYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)$non_lazy_ptr-(LPC6_0+8)) +LPC6_0: ldr r4, [pc, r4] ldr r0, [r4] dmb ish cmp r0, #3 - bne LBB5_2 -LBB5_1: + bne LBB6_2 +LBB6_1: ldrh r1, [r4, #6] mov r0, #0 cmp r1, #17 movwhi r0, #1 pop {r4, r7, pc} -LBB5_2: +LBB6_2: bl SYM(>::initialize::<>::get_or_init::{closure#0}, !>, 0) - b LBB5_1 + b LBB6_1 + + .globl _only_ios + .p2align 2 + .code 32 +_only_ios: + mov r0, #1 + bx lr .section __DATA,__const .p2align 2, 0x0 diff --git a/crates/test-assembly/crates/test_available/expected/apple-x86.s b/crates/test-assembly/crates/test_available/expected/apple-x86.s index 1f306c147..b53a43b0c 100644 --- a/crates/test-assembly/crates/test_available/expected/apple-x86.s +++ b/crates/test-assembly/crates/test_available/expected/apple-x86.s @@ -118,6 +118,15 @@ _always: pop ebp ret + .globl _never + .p2align 4, 0x90 +_never: + push ebp + mov ebp, esp + xor eax, eax + pop ebp + ret + .globl _low .p2align 4, 0x90 _low: @@ -134,23 +143,32 @@ _high: mov ebp, esp push esi push eax - call L5$pb -L5$pb: + call L6$pb +L6$pb: pop eax - mov esi, dword ptr [eax + LSYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)$non_lazy_ptr-L5$pb] + mov esi, dword ptr [eax + LSYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)$non_lazy_ptr-L6$pb] mov eax, dword ptr [esi] cmp eax, 3 - jne LBB5_1 -LBB5_2: + jne LBB6_1 +LBB6_2: cmp word ptr [esi + 6], 15 setae al add esp, 4 pop esi pop ebp ret -LBB5_1: +LBB6_1: call SYM(>::initialize::<>::get_or_init::{closure#0}, !>, 0) - jmp LBB5_2 + jmp LBB6_2 + + .globl _only_ios + .p2align 4, 0x90 +_only_ios: + push ebp + mov ebp, esp + xor eax, eax + pop ebp + ret .section __DATA,__const .p2align 2, 0x0 diff --git a/crates/test-assembly/crates/test_available/expected/apple-x86_64.s b/crates/test-assembly/crates/test_available/expected/apple-x86_64.s index 59fc34f8b..c7cc3b694 100644 --- a/crates/test-assembly/crates/test_available/expected/apple-x86_64.s +++ b/crates/test-assembly/crates/test_available/expected/apple-x86_64.s @@ -91,6 +91,15 @@ _always: pop rbp ret + .globl _never + .p2align 4, 0x90 +_never: + push rbp + mov rbp, rsp + xor eax, eax + pop rbp + ret + .globl _low .p2align 4, 0x90 _low: @@ -110,17 +119,26 @@ _high: mov rbx, qword ptr [rip + SYM(objc2::__macro_helpers::os_version::apple::current_version::CURRENT_VERSION::GENERATED_ID, 0)@GOTPCREL] mov rax, qword ptr [rbx] cmp rax, 3 - jne LBB5_1 -LBB5_2: + jne LBB6_1 +LBB6_2: cmp word ptr [rbx + 10], 15 setae al add rsp, 8 pop rbx pop rbp ret -LBB5_1: +LBB6_1: call SYM(>::initialize::<>::get_or_init::{closure#0}, !>, 0) - jmp LBB5_2 + jmp LBB6_2 + + .globl _only_ios + .p2align 4, 0x90 +_only_ios: + push rbp + mov rbp, rsp + xor eax, eax + pop rbp + ret .section __DATA,__const .p2align 3, 0x0 diff --git a/crates/test-assembly/crates/test_available/expected/gnustep-x86.s b/crates/test-assembly/crates/test_available/expected/gnustep-x86.s index 83fd37fc6..b296e58bf 100644 --- a/crates/test-assembly/crates/test_available/expected/gnustep-x86.s +++ b/crates/test-assembly/crates/test_available/expected/gnustep-x86.s @@ -10,6 +10,16 @@ always: .Lfunc_end0: .size always, .Lfunc_end0-always + .section .text.never,"ax",@progbits + .globl never + .p2align 4, 0x90 + .type never,@function +never: + xor eax, eax + ret +.Lfunc_end1: + .size never, .Lfunc_end1-never + .section .text.low,"ax",@progbits .globl low .p2align 4, 0x90 @@ -17,8 +27,8 @@ always: low: mov al, 1 ret -.Lfunc_end1: - .size low, .Lfunc_end1-low +.Lfunc_end2: + .size low, .Lfunc_end2-low .section .text.high,"ax",@progbits .globl high @@ -27,7 +37,17 @@ low: high: mov al, 1 ret -.Lfunc_end2: - .size high, .Lfunc_end2-high +.Lfunc_end3: + .size high, .Lfunc_end3-high + + .section .text.only_ios,"ax",@progbits + .globl only_ios + .p2align 4, 0x90 + .type only_ios,@function +only_ios: + xor eax, eax + ret +.Lfunc_end4: + .size only_ios, .Lfunc_end4-only_ios .section ".note.GNU-stack","",@progbits diff --git a/crates/test-assembly/crates/test_available/expected/gnustep-x86_64.s b/crates/test-assembly/crates/test_available/expected/gnustep-x86_64.s index 83fd37fc6..b296e58bf 100644 --- a/crates/test-assembly/crates/test_available/expected/gnustep-x86_64.s +++ b/crates/test-assembly/crates/test_available/expected/gnustep-x86_64.s @@ -10,6 +10,16 @@ always: .Lfunc_end0: .size always, .Lfunc_end0-always + .section .text.never,"ax",@progbits + .globl never + .p2align 4, 0x90 + .type never,@function +never: + xor eax, eax + ret +.Lfunc_end1: + .size never, .Lfunc_end1-never + .section .text.low,"ax",@progbits .globl low .p2align 4, 0x90 @@ -17,8 +27,8 @@ always: low: mov al, 1 ret -.Lfunc_end1: - .size low, .Lfunc_end1-low +.Lfunc_end2: + .size low, .Lfunc_end2-low .section .text.high,"ax",@progbits .globl high @@ -27,7 +37,17 @@ low: high: mov al, 1 ret -.Lfunc_end2: - .size high, .Lfunc_end2-high +.Lfunc_end3: + .size high, .Lfunc_end3-high + + .section .text.only_ios,"ax",@progbits + .globl only_ios + .p2align 4, 0x90 + .type only_ios,@function +only_ios: + xor eax, eax + ret +.Lfunc_end4: + .size only_ios, .Lfunc_end4-only_ios .section ".note.GNU-stack","",@progbits diff --git a/crates/test-assembly/crates/test_available/lib.rs b/crates/test-assembly/crates/test_available/lib.rs index 9aef195ad..000114215 100644 --- a/crates/test-assembly/crates/test_available/lib.rs +++ b/crates/test-assembly/crates/test_available/lib.rs @@ -7,6 +7,12 @@ fn always() -> bool { available!(..) } +#[no_mangle] +fn never() -> bool { + // Can elide the version check here + available!() +} + #[no_mangle] fn low() -> bool { // Can elide the version check here @@ -32,3 +38,9 @@ fn high() -> bool { .. ) } + +#[no_mangle] +fn only_ios() -> bool { + // Can elide the version check here on macOS + available!(ios = 5.0) +} diff --git a/crates/test-ui/ui/available_invalid.stderr b/crates/test-ui/ui/available_invalid.stderr index 83e94e228..9e9c08026 100644 --- a/crates/test-ui/ui/available_invalid.stderr +++ b/crates/test-ui/ui/available_invalid.stderr @@ -15,8 +15,8 @@ error: no rules expected the token `ABCD` note: while trying to match meta-variable `$major:literal` --> $WORKSPACE/crates/objc2/src/macros/available.rs | - | $os:ident = $major:literal $(. $minor:literal $(. $patch:literal)?)? - | ^^^^^^^^^^^^^^ + | $os:ident $(= $major:literal $(. $minor:literal $(. $patch:literal)?)?)? + | ^^^^^^^^^^^^^^ error: unexpected end of macro invocation --> ui/available_invalid.rs @@ -27,8 +27,8 @@ error: unexpected end of macro invocation note: while trying to match meta-variable `$major:literal` --> $WORKSPACE/crates/objc2/src/macros/available.rs | - | $os:ident = $major:literal $(. $minor:literal $(. $patch:literal)?)? - | ^^^^^^^^^^^^^^ + | $os:ident $(= $major:literal $(. $minor:literal $(. $patch:literal)?)?)? + | ^^^^^^^^^^^^^^ error: no rules expected the token `:` --> ui/available_invalid.rs @@ -36,20 +36,15 @@ error: no rules expected the token `:` | available!(macos: 1.2); | ^ no rules expected this token in macro call | -note: while trying to match `=` - --> $WORKSPACE/crates/objc2/src/macros/available.rs - | - | $os:ident = $major:literal $(. $minor:literal $(. $patch:literal)?)? - | ^ + = note: while trying to match sequence start -error: unexpected end of macro invocation +error: expected expression, found `,` --> ui/available_invalid.rs | | available!(macos); - | ^ missing tokens in macro arguments - | -note: while trying to match `=` - --> $WORKSPACE/crates/objc2/src/macros/available.rs + | ^^^^^^^^^^^^^^^^^ + | | + | expected expression + | while parsing this struct | - | $os:ident = $major:literal $(. $minor:literal $(. $patch:literal)?)? - | ^ + = note: this error originates in the macro `available` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/test-ui/ui/available_missing_current_os.rs b/crates/test-ui/ui/available_missing_current_os.rs deleted file mode 100644 index 892300e17..000000000 --- a/crates/test-ui/ui/available_missing_current_os.rs +++ /dev/null @@ -1,10 +0,0 @@ -//! Missing current OS in `available!` macro. -use objc2::available; - -fn main() { - // Disallow - available!(ios = 1.2); - - // Allow - available!(ios = 1.2, ..); -} diff --git a/crates/test-ui/ui/available_missing_current_os.stderr b/crates/test-ui/ui/available_missing_current_os.stderr deleted file mode 100644 index 873eaec24..000000000 --- a/crates/test-ui/ui/available_missing_current_os.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0063]: missing field `macos` in initializer of `AvailableVersion` - --> ui/available_missing_current_os.rs - | - | available!(ios = 1.2); - | ^^^^^^^^^^^^^^^^^^^^^ missing `macos` - | - = note: this error originates in the macro `$crate::__available_fields` which comes from the expansion of the macro `available` (in Nightly builds, run with -Z macro-backtrace for more info)