Skip to content

Commit 3fa28cc

Browse files
author
Stjepan Glavina
committed
Add a note about overflow for fetch_add/fetch_sub
1 parent c6df67a commit 3fa28cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libcore/sync/atomic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,8 @@ macro_rules! atomic_int {
11711171

11721172
/// Add to the current value, returning the previous value.
11731173
///
1174+
/// This operation wraps around on overflow.
1175+
///
11741176
/// # Examples
11751177
///
11761178
/// ```
@@ -1188,6 +1190,8 @@ macro_rules! atomic_int {
11881190

11891191
/// Subtract from the current value, returning the previous value.
11901192
///
1193+
/// This operation wraps around on overflow.
1194+
///
11911195
/// # Examples
11921196
///
11931197
/// ```

0 commit comments

Comments
 (0)