Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shahn committed Dec 19, 2015
1 parent 9697076 commit 7dd618f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/liballoc/arc.rs
Expand Up @@ -924,19 +924,18 @@ impl<T> Weak<T> {
///
/// use std::sync::Arc;
///
/// let five = Arc::new(5);
/// let empty: Weak<i64> = Weak::new();
/// ```
#[unstable(feature = "downgraded_weak",
reason = "recently added",
issue = "30425")]
pub fn new() -> Weak<T> {
unsafe {
let x: Box<_> = box ArcInner {
Weak { _ptr: Shared::new(Box::into_raw(box ArcInner {
strong: atomic::AtomicUsize::new(0),
weak: atomic::AtomicUsize::new(1),
data: uninitialized(),
};
Weak { _ptr: Shared::new(Box::into_raw(x)) }
}))}
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/liballoc/rc.rs
Expand Up @@ -843,9 +843,8 @@ impl<T> Weak<T> {
///
/// use std::rc::Weak;
///
/// let empty:Weak<i64> = Weak::new();
/// let empty: Weak<i64> = Weak::new();
/// ```

#[unstable(feature = "downgraded_weak",
reason = "recently added",
issue="30425")]
Expand Down

0 comments on commit 7dd618f

Please sign in to comment.