]> git.proxmox.com Git - cargo.git/commitdiff
Allow unused_unsafe in LazyCell in preparation for lib change
authorvarkor <github@varkor.com>
Wed, 24 Jan 2018 09:46:54 +0000 (09:46 +0000)
committerGitHub <noreply@github.com>
Wed, 24 Jan 2018 09:46:54 +0000 (09:46 +0000)
https://github.com/rust-lang/rust/pull/47204 makes `UnsafeCell::into_inner` safe, which means `LazyCell::into_inner` will no longer need an `unsafe` block. `LazyCell` is a blocker for the change in Rust: this fix should allow the change to take place.

src/cargo/util/lazy_cell.rs

index 607f2ef982ed412472b868da5ada3aa4b2361e9c..a552541752726caefc34239da53a9b4bce206332 100644 (file)
@@ -55,6 +55,7 @@ impl<T> LazyCell<T> {
     }
 
     /// Consumes this `LazyCell`, returning the underlying value.
+    #[allow(unused_unsafe)]
     pub fn into_inner(self) -> Option<T> {
         unsafe {
             self.inner.into_inner()