diff --git a/src/lib.rs b/src/lib.rs index 94bac120..f7721488 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,6 +86,7 @@ extern crate log; #[macro_use] extern crate serde; #[macro_use] +#[cfg(target_os = "windows")] extern crate derivative; #[macro_use] #[cfg(target_os = "windows")] diff --git a/src/platform_impl/macos/app_state.rs b/src/platform_impl/macos/app_state.rs index 354325bb..27aedb1c 100644 --- a/src/platform_impl/macos/app_state.rs +++ b/src/platform_impl/macos/app_state.rs @@ -1,5 +1,5 @@ use std::{ - collections::VecDeque, fmt::{self, Debug, Formatter}, + collections::VecDeque, fmt::{self, Debug}, hint::unreachable_unchecked, mem, sync::{atomic::{AtomicBool, Ordering}, Mutex, MutexGuard}, time::Instant, }; diff --git a/src/platform_impl/macos/observer.rs b/src/platform_impl/macos/observer.rs index 6289e914..8e11af3b 100644 --- a/src/platform_impl/macos/observer.rs +++ b/src/platform_impl/macos/observer.rs @@ -54,6 +54,7 @@ extern { source: CFRunLoopSourceRef, mode: CFRunLoopMode, ); + #[allow(dead_code)] pub fn CFRunLoopSourceInvalidate(source: CFRunLoopSourceRef); pub fn CFRunLoopSourceSignal(source: CFRunLoopSourceRef); @@ -62,6 +63,7 @@ extern { } pub type Boolean = u8; +#[allow(dead_code)] const FALSE: Boolean = 0; const TRUE: Boolean = 1; @@ -87,9 +89,13 @@ pub type CFRunLoopActivity = CFOptionFlags; pub type CFAbsoluteTime = CFTimeInterval; pub type CFTimeInterval = f64; +#[allow(non_upper_case_globals)] pub const kCFRunLoopEntry: CFRunLoopActivity = 0; +#[allow(non_upper_case_globals)] pub const kCFRunLoopBeforeWaiting: CFRunLoopActivity = 1 << 5; +#[allow(non_upper_case_globals)] pub const kCFRunLoopAfterWaiting: CFRunLoopActivity = 1 << 6; +#[allow(non_upper_case_globals)] pub const kCFRunLoopExit: CFRunLoopActivity = 1 << 7; pub type CFRunLoopObserverCallBack = extern "C" fn( @@ -105,6 +111,7 @@ pub type CFRunLoopTimerCallBack = extern "C" fn( pub enum CFRunLoopObserverContext {} pub enum CFRunLoopTimerContext {} +#[allow(non_snake_case)] #[repr(C)] pub struct CFRunLoopSourceContext { pub version: CFIndex, diff --git a/tests/send_objects.rs b/tests/send_objects.rs index c06392c8..77da9cbf 100644 --- a/tests/send_objects.rs +++ b/tests/send_objects.rs @@ -4,6 +4,7 @@ fn needs_send() {} #[test] fn event_loop_proxy_send() { + #[allow(dead_code)] fn is_send() { // ensures that `winit::EventLoopProxy` implements `Send` needs_send::>();