Skip to content

Commit 8d14c03

Browse files
authored
Explicitly mention overflow is what we're checking
1 parent f5dd42b commit 8d14c03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/alloc/src/rc.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2524,8 +2524,8 @@ trait RcInnerPtr {
25242524
self.strong_ref().set(strong);
25252525

25262526
// We want to abort on overflow instead of dropping the value.
2527-
// Checking after the store instead of before allows for
2528-
// slightly better code generation.
2527+
// Checking for overflow after the store instead of before
2528+
// allows for slightly better code generation.
25292529
if core::intrinsics::unlikely(strong == 0) {
25302530
abort();
25312531
}
@@ -2557,8 +2557,8 @@ trait RcInnerPtr {
25572557
self.weak_ref().set(weak);
25582558

25592559
// We want to abort on overflow instead of dropping the value.
2560-
// Checking after the store instead of before allows for
2561-
// slightly better code generation.
2560+
// Checking for overflow after the store instead of before
2561+
// allows for slightly better code generation.
25622562
if core::intrinsics::unlikely(weak == 0) {
25632563
abort();
25642564
}

0 commit comments

Comments
 (0)