about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-10-17 22:42:19 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-10-17 22:44:08 +0200
commit8ed0d0d98070318cf56d02b6c3171035b0c57ddf (patch)
treeaadb796aa3f86bde09bcba686e46acf826e06aec /src
parent3aae6fb4942d53105f0a699b8fbc07e8dd0aa9c9 (diff)
downloadrust-8ed0d0d98070318cf56d02b6c3171035b0c57ddf.tar.gz
rust-8ed0d0d98070318cf56d02b6c3171035b0c57ddf.zip
Remove unnecessary Lazy
Found by m-ou-se in https://github.com/bjorn3/rustc_codegen_cranelift/pull/1166#discussion_r730468919
Diffstat (limited to 'src')
-rw-r--r--src/driver/jit.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/driver/jit.rs b/src/driver/jit.rs
index 76fbc9ad51e..31f335bbd7d 100644
--- a/src/driver/jit.rs
+++ b/src/driver/jit.rs
@@ -3,7 +3,7 @@
 
 use std::cell::RefCell;
 use std::ffi::CString;
-use std::lazy::{Lazy, SyncOnceCell};
+use std::lazy::SyncOnceCell;
 use std::os::raw::{c_char, c_int};
 use std::sync::{mpsc, Mutex};
 
@@ -50,12 +50,11 @@ impl UnsafeMessage {
     fn send(self) -> Result<(), mpsc::SendError<UnsafeMessage>> {
         thread_local! {
             /// The Sender owned by the local thread
-            static LOCAL_MESSAGE_SENDER: Lazy<mpsc::Sender<UnsafeMessage>> = Lazy::new(||
+            static LOCAL_MESSAGE_SENDER: mpsc::Sender<UnsafeMessage> =
                 GLOBAL_MESSAGE_SENDER
                     .get().unwrap()
                     .lock().unwrap()
-                    .clone()
-            );
+                    .clone();
         }
         LOCAL_MESSAGE_SENDER.with(|sender| sender.send(self))
     }