about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-22 15:22:49 +0000
committerbors <bors@rust-lang.org>2024-03-22 15:22:49 +0000
commit2fae357cb87d6ec184a34892394d4e737ecd6030 (patch)
tree2e95d58c16c36d9159307f386ce1912c94bc4fff /compiler/rustc_data_structures/src
parentf61f45f2336ad473ca152252f81e447ae19e0553 (diff)
parentee57d2b318fc17080740172896269cd9865a17f4 (diff)
downloadrust-2fae357cb87d6ec184a34892394d4e737ecd6030.tar.gz
rust-2fae357cb87d6ec184a34892394d4e737ecd6030.zip
Auto merge of #3394 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/sync.rs9
-rw-r--r--compiler/rustc_data_structures/src/sync/lock.rs1
2 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs
index 32202ac3ede..eab6d8168ca 100644
--- a/compiler/rustc_data_structures/src/sync.rs
+++ b/compiler/rustc_data_structures/src/sync.rs
@@ -20,6 +20,7 @@
 //! | ----------------------- | ------------------- | ------------------------------- |
 //! | `Lrc<T>`                | `rc::Rc<T>`         | `sync::Arc<T>`                  |
 //! |` Weak<T>`               | `rc::Weak<T>`       | `sync::Weak<T>`                 |
+//! | `LRef<'a, T>` [^2]      | `&'a mut T`         | `&'a T`                         |
 //! |                         |                     |                                 |
 //! | `AtomicBool`            | `Cell<bool>`        | `atomic::AtomicBool`            |
 //! | `AtomicU32`             | `Cell<u32>`         | `atomic::AtomicU32`             |
@@ -38,7 +39,7 @@
 //! of a `RefCell`. This is appropriate when interior mutability is not
 //! required.
 //!
-//! [^2] `MTLockRef` is a typedef.
+//! [^2] `MTRef`, `MTLockRef` are type aliases.
 
 pub use crate::marker::*;
 use std::collections::HashMap;
@@ -208,7 +209,7 @@ cfg_match! {
 
         use std::cell::RefCell as InnerRwLock;
 
-        pub type MTLockRef<'a, T> = &'a mut MTLock<T>;
+        pub type LRef<'a, T> = &'a mut T;
 
         #[derive(Debug, Default)]
         pub struct MTLock<T>(T);
@@ -274,7 +275,7 @@ cfg_match! {
         pub use std::sync::Arc as Lrc;
         pub use std::sync::Weak as Weak;
 
-        pub type MTLockRef<'a, T> = &'a MTLock<T>;
+        pub type LRef<'a, T> = &'a T;
 
         #[derive(Debug, Default)]
         pub struct MTLock<T>(Lock<T>);
@@ -314,6 +315,8 @@ cfg_match! {
     }
 }
 
+pub type MTLockRef<'a, T> = LRef<'a, MTLock<T>>;
+
 #[derive(Default)]
 #[cfg_attr(parallel_compiler, repr(align(64)))]
 pub struct CacheAligned<T>(pub T);
diff --git a/compiler/rustc_data_structures/src/sync/lock.rs b/compiler/rustc_data_structures/src/sync/lock.rs
index 040a8aa6b63..756984642c7 100644
--- a/compiler/rustc_data_structures/src/sync/lock.rs
+++ b/compiler/rustc_data_structures/src/sync/lock.rs
@@ -189,6 +189,7 @@ mod no_sync {
     use super::Mode;
     use std::cell::RefCell;
 
+    #[doc(no_inline)]
     pub use std::cell::RefMut as LockGuard;
 
     pub struct Lock<T>(RefCell<T>);