1
Fork 0

More test fixes and fallout of stability changes

This commit is contained in:
Alex Crichton 2015-06-10 19:33:04 -07:00
parent aa931e9c6f
commit b4a2823cd6
40 changed files with 111 additions and 122 deletions

View file

@ -290,7 +290,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { Arc::strong_count(this)
reason = "this function is unsafe with weak pointers")]
pub unsafe fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> {
// FIXME(#24880) potential race with upgraded weak pointers here
if strong_count(this) == 1 && weak_count(this) == 0 {
if Arc::strong_count(this) == 1 && Arc::weak_count(this) == 0 {
// This unsafety is ok because we're guaranteed that the pointer
// returned is the *only* pointer that will ever be returned to T. Our
// reference count is guaranteed to be 1 at this point, and we required