fix warnings

This commit is contained in:
Jorge Aparicio 2020-05-03 16:09:56 +02:00 committed by Emil Fresk
parent e4580da8a8
commit 596a1f03f1
4 changed files with 7 additions and 8 deletions

View File

@ -73,8 +73,7 @@
#![deny(missing_docs)] #![deny(missing_docs)]
#![deny(rust_2018_compatibility)] #![deny(rust_2018_compatibility)]
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
// #![deny(warnings)] #![deny(warnings)]
#![allow(warnings)] // FIXME
pub use binary_heap::BinaryHeap; pub use binary_heap::BinaryHeap;
pub use generic_array::typenum::consts; pub use generic_array::typenum::consts;

View File

@ -7,7 +7,7 @@ use core::{
cell::UnsafeCell, cell::UnsafeCell,
convert::TryFrom, convert::TryFrom,
marker::PhantomData, marker::PhantomData,
mem::{self, MaybeUninit}, mem,
num::NonZeroUsize, num::NonZeroUsize,
ptr::NonNull, ptr::NonNull,
sync::atomic::{AtomicUsize, Ordering}, sync::atomic::{AtomicUsize, Ordering},

View File

@ -4,9 +4,11 @@ pub use core::ptr::NonNull as Ptr;
use core::{ use core::{
cell::UnsafeCell, cell::UnsafeCell,
ptr, ptr,
sync::atomic::{self, AtomicPtr, Ordering}, sync::atomic::{AtomicPtr, Ordering},
}; };
/// Unfortunate implementation detail required to use the
/// [`Pool.grow_exact`](struct.Pool.html#method.grow_exact) method
pub struct Node<T> { pub struct Node<T> {
next: AtomicPtr<Node<T>>, next: AtomicPtr<Node<T>>,
pub(crate) data: UnsafeCell<T>, pub(crate) data: UnsafeCell<T>,

View File

@ -224,16 +224,14 @@
//! //!
//! 4. "Hazard pointers: Safe memory reclamation for lock-free objects." Michael, Maged M. //! 4. "Hazard pointers: Safe memory reclamation for lock-free objects." Michael, Maged M.
use core::{any::TypeId, mem, sync::atomic::Ordering}; use core::{any::TypeId, mem};
use core::{ use core::{
cell::UnsafeCell,
cmp, fmt, cmp, fmt,
hash::{Hash, Hasher}, hash::{Hash, Hasher},
marker::PhantomData, marker::PhantomData,
mem::MaybeUninit, mem::MaybeUninit,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
ptr, ptr,
sync::atomic::AtomicPtr,
}; };
use as_slice::{AsMutSlice, AsSlice}; use as_slice::{AsMutSlice, AsSlice};
@ -394,7 +392,7 @@ impl<T> Pool<T> {
} }
#[cfg(not(target_arch = "x86_64"))] #[cfg(not(target_arch = "x86_64"))]
() => self.stack.push(NonNull::from(p)), () => self.stack.push(core::ptr::NonNull::from(p)),
} }
} }
cap cap