diff --git a/src/lib.rs b/src/lib.rs index 7b2d200..d492637 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,7 +135,11 @@ impl LazyCell { /// Consumes this `LazyCell`, returning the underlying value. pub fn into_inner(self) -> Option { - self.inner.into_inner() + // Rust 1.25 changed UnsafeCell::into_inner() from unsafe to safe + // function. This unsafe can be removed when supporting Rust older than + // 1.25 is not needed. + #[allow(unused_unsafe)] + unsafe { self.inner.into_inner() } } } @@ -206,7 +210,11 @@ impl AtomicLazyCell { /// Consumes this `LazyCell`, returning the underlying value. pub fn into_inner(self) -> Option { - self.inner.into_inner() + // Rust 1.25 changed UnsafeCell::into_inner() from unsafe to safe + // function. This unsafe can be removed when supporting Rust older than + // 1.25 is not needed. + #[allow(unused_unsafe)] + unsafe { self.inner.into_inner() } } }