]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_metadata/src/dynamic_lib.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / compiler / rustc_metadata / src / dynamic_lib.rs
index 1a900ccbf65faeed61a07c03f4e26755eee44eeb..e8929cd5c0237b91eff421c617c40c3683e5d363 100644 (file)
@@ -70,13 +70,12 @@ mod dl {
         use std::sync::{Mutex, MutexGuard};
 
         pub fn lock() -> MutexGuard<'static, Guard> {
-            static LOCK: SyncLazy<Mutex<Guard>> = SyncLazy::new(|| Mutex::new(Guard { _priv: () }));
+            static LOCK: SyncLazy<Mutex<Guard>> = SyncLazy::new(|| Mutex::new(Guard));
             LOCK.lock().unwrap()
         }
 
-        pub struct Guard {
-            _priv: (),
-        }
+        #[non_exhaustive]
+        pub struct Guard;
 
         impl Guard {
             pub fn get(&mut self) -> Result<(), String> {