diff --git a/example/arbitrary_self_types_pointers_and_wrappers.rs b/example/arbitrary_self_types_pointers_and_wrappers.rs index 5e7d4762179..10934cebcf1 100644 --- a/example/arbitrary_self_types_pointers_and_wrappers.rs +++ b/example/arbitrary_self_types_pointers_and_wrappers.rs @@ -9,7 +9,6 @@ extern crate mini_core; use mini_core::*; -use mini_core::libc::*; macro_rules! assert_eq { ($l:expr, $r: expr) => { diff --git a/example/mini_core.rs b/example/mini_core.rs index 84664eb4139..fc31daf596f 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -430,6 +430,7 @@ pub trait Drop { fn drop(&mut self); } +#[allow(unions_with_drop_fields)] pub union MaybeUninit { pub uninit: (), pub value: T, diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs index 48ae80baaad..47d046d0e1b 100644 --- a/example/mini_core_hello_world.rs +++ b/example/mini_core_hello_world.rs @@ -149,7 +149,7 @@ fn main() { let world: Box<&str> = box "World!\0"; puts(*world as *const str as *const u8); - world as Box; + world as Box; assert_eq!(intrinsics::bitreverse(0b10101000u8), 0b00010101u8); @@ -212,7 +212,7 @@ fn main() { let _ = box NoisyDrop { text: "Boxed outer got dropped!\0", inner: NoisyDropInner, - } as Box; + } as Box; const FUNC_REF: Option = Some(main); match FUNC_REF { @@ -249,5 +249,5 @@ fn main() { unsafe { assert_eq!(ABC as usize, 0); } - &mut (|| Some(0 as *const ())) as &mut FnMut() -> Option<*const ()>; + &mut (|| Some(0 as *const ())) as &mut dyn FnMut() -> Option<*const ()>; } diff --git a/example/std_example.rs b/example/std_example.rs index c0f236055ab..7d1d8facdbe 100644 --- a/example/std_example.rs +++ b/example/std_example.rs @@ -2,12 +2,10 @@ use std::arch::x86_64::*; use std::io::Write; -use std::intrinsics; - fn main() { let mutex = std::sync::Mutex::new(()); - mutex.lock().unwrap(); + let _guard = mutex.lock().unwrap(); let _ = ::std::iter::repeat('a' as u8).take(10).collect::>(); let stderr = ::std::io::stderr(); @@ -19,10 +17,10 @@ fn main() { println!("cargo:rustc-link-lib=z"); - static ONCE: std::sync::Once = std::sync::ONCE_INIT; + static ONCE: std::sync::Once = std::sync::Once::new(); ONCE.call_once(|| {}); - LoopState::Continue(()) == LoopState::Break(()); + let _eq = LoopState::Continue(()) == LoopState::Break(()); // Make sure ByValPair values with differently sized components are correctly passed map(None::<(u8, Box)>); @@ -41,8 +39,8 @@ fn main() { assert_eq!(0b0000000000000000000000000010000010000000000000000000000000000000_0000000000100000000000000000000000001000000000000100000000000000u128.leading_zeros(), 26); assert_eq!(0b0000000000000000000000000010000000000000000000000000000000000000_0000000000000000000000000000000000001000000000000000000010000000u128.trailing_zeros(), 7); - 0i128.checked_div(2i128); - 0u128.checked_div(2u128); + let _d = 0i128.checked_div(2i128); + let _d = 0u128.checked_div(2u128); assert_eq!(1u128 + 2, 3); assert_eq!(0b100010000000000000000000000000000u128 >> 10, 0b10001000000000000000000u128); @@ -165,7 +163,7 @@ unsafe fn test_mm_add_pd() { fn assert_eq_m128i(x: std::arch::x86_64::__m128i, y: std::arch::x86_64::__m128i) { unsafe { - assert_eq!(std::mem::transmute::<_, [u8; 16]>(x), std::mem::transmute::<_, [u8; 16]>(x)); + assert_eq!(std::mem::transmute::<_, [u8; 16]>(x), std::mem::transmute::<_, [u8; 16]>(y)); } }