]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys_common/rwlock.rs
Auto merge of #98221 - cjgillot:single-coh, r=lcnr
[rust.git] / library / std / src / sys_common / rwlock.rs
index abc9fd561f1f60d89d97157474be1274a6b32007..ba56f3a8f1b5263b5a46d84848b27f702b7b3b90 100644 (file)
@@ -10,6 +10,7 @@
 
 impl StaticRwLock {
     /// Creates a new rwlock for use.
+    #[inline]
     pub const fn new() -> Self {
         Self(imp::RwLock::new())
     }
@@ -61,19 +62,20 @@ fn drop(&mut self) {
 
 /// An OS-based reader-writer lock.
 ///
-/// This rwlock does *not* have a const constructor, cleans up its resources in
-/// its `Drop` implementation and may safely be moved (when not borrowed).
+/// This rwlock cleans up its resources in its `Drop` implementation and may
+/// safely be moved (when not borrowed).
 ///
 /// This rwlock does not implement poisoning.
 ///
-/// This is either a wrapper around `Box<imp::RwLock>` or `imp::RwLock`,
+/// This is either a wrapper around `LazyBox<imp::RwLock>` or `imp::RwLock`,
 /// depending on the platform. It is boxed on platforms where `imp::RwLock` may
 /// not be moved.
 pub struct MovableRwLock(imp::MovableRwLock);
 
 impl MovableRwLock {
     /// Creates a new reader-writer lock for use.
-    pub fn new() -> Self {
+    #[inline]
+    pub const fn new() -> Self {
         Self(imp::MovableRwLock::new())
     }