mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Address comments
This commit is contained in:
parent
391f800705
commit
cf1238e799
@ -101,8 +101,8 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[clippy::has_significant_drop]
|
||||
pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
|
||||
data: *const T,
|
||||
inner_lock: &'a sys::MovableRwLock,
|
||||
data: &'a T,
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
@ -513,7 +513,7 @@ impl<'rwlock, T: ?Sized> RwLockReadGuard<'rwlock, T> {
|
||||
unsafe fn new(lock: &'rwlock RwLock<T>) -> LockResult<RwLockReadGuard<'rwlock, T>> {
|
||||
poison::map_result(lock.poison.borrow(), |()| RwLockReadGuard {
|
||||
inner_lock: &lock.inner,
|
||||
data: &*lock.data.get(),
|
||||
data: lock.data.get(),
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -557,7 +557,7 @@ impl<T: ?Sized> Deref for RwLockReadGuard<'_, T> {
|
||||
type Target = T;
|
||||
|
||||
fn deref(&self) -> &T {
|
||||
self.data
|
||||
unsafe { &*self.data }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user