mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Explicitly mention overflow is what we're checking
This commit is contained in:
parent
f5dd42bce5
commit
8d14c03568
@ -2524,8 +2524,8 @@ trait RcInnerPtr {
|
|||||||
self.strong_ref().set(strong);
|
self.strong_ref().set(strong);
|
||||||
|
|
||||||
// We want to abort on overflow instead of dropping the value.
|
// We want to abort on overflow instead of dropping the value.
|
||||||
// Checking after the store instead of before allows for
|
// Checking for overflow after the store instead of before
|
||||||
// slightly better code generation.
|
// allows for slightly better code generation.
|
||||||
if core::intrinsics::unlikely(strong == 0) {
|
if core::intrinsics::unlikely(strong == 0) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
@ -2557,8 +2557,8 @@ trait RcInnerPtr {
|
|||||||
self.weak_ref().set(weak);
|
self.weak_ref().set(weak);
|
||||||
|
|
||||||
// We want to abort on overflow instead of dropping the value.
|
// We want to abort on overflow instead of dropping the value.
|
||||||
// Checking after the store instead of before allows for
|
// Checking for overflow after the store instead of before
|
||||||
// slightly better code generation.
|
// allows for slightly better code generation.
|
||||||
if core::intrinsics::unlikely(weak == 0) {
|
if core::intrinsics::unlikely(weak == 0) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user