libs: add Deref, DerefMut impls for references, fixing a bug in compiler in the process that was blocking this.
Fixes #18621.
This commit is contained in:
parent
e84e7a00dd
commit
f2aaed8338
6 changed files with 78 additions and 8 deletions
|
|
@ -166,7 +166,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
|
|||
// additional reference of either kind.
|
||||
if self.inner().strong.load(atomic::SeqCst) != 1 ||
|
||||
self.inner().weak.load(atomic::SeqCst) != 1 {
|
||||
*self = Arc::new(self.deref().clone())
|
||||
*self = Arc::new((**self).clone())
|
||||
}
|
||||
// This unsafety is ok because we're guaranteed that the pointer
|
||||
// returned is the *only* pointer that will ever be returned to T. Our
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue