diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index b1b56f321fc6b..846d9742fc1f4 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -65,7 +65,7 @@ use crate::sys_common::rwlock as sys; /// [`Mutex`]: struct.Mutex.html #[stable(feature = "rust1", since = "1.0.0")] pub struct RwLock { - inner: Box, + inner: sys::RWLock, poison: poison::Flag, data: UnsafeCell, } @@ -129,9 +129,9 @@ impl RwLock { /// let lock = RwLock::new(5); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub fn new(t: T) -> RwLock { + pub const fn new(t: T) -> RwLock { RwLock { - inner: box sys::RWLock::new(), + inner: sys::RWLock::new(), poison: poison::Flag::new(), data: UnsafeCell::new(t), }