We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3f25c5c + 0fc1f9a commit 529689fCopy full SHA for 529689f
src/liballoc/arc.rs
@@ -637,6 +637,11 @@ impl<T: ?Sized> Weak<T> {
637
return None
638
}
639
640
+ // See comments in `Arc::clone` for why we do this (for `mem::forget`).
641
+ if n > MAX_REFCOUNT {
642
+ unsafe { abort(); }
643
+ }
644
+
645
// Relaxed is valid for the same reason it is on Arc's Clone impl
646
let old = inner.strong.compare_and_swap(n, n + 1, Relaxed);
647
if old == n {
0 commit comments