diff options
| author | bors <bors@rust-lang.org> | 2017-08-09 11:10:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-08-09 11:10:23 +0000 |
| commit | c2de81f4c97c8d1af685162f5a6faf8c89f6cd83 (patch) | |
| tree | 63e11f94424c161b9a3591658b3df4ad67b6b0dc /src/libstd/sync | |
| parent | 3f977baf34ed32c64c4ff185b4ef6ae2c2948afc (diff) | |
| parent | 702750c538c56905f58b60520dd1e9814ba03a8e (diff) | |
| download | rust-c2de81f4c97c8d1af685162f5a6faf8c89f6cd83.tar.gz rust-c2de81f4c97c8d1af685162f5a6faf8c89f6cd83.zip | |
Auto merge of #43588 - dns2utf8:wrapping_add, r=sfackler
Use explicit wrapping_add … … to prevent potential unexpected behavior on debug builds.
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/barrier.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sync/barrier.rs b/src/libstd/sync/barrier.rs index a7b01e49d2b..273c7c1c54a 100644 --- a/src/libstd/sync/barrier.rs +++ b/src/libstd/sync/barrier.rs @@ -152,7 +152,7 @@ impl Barrier { BarrierWaitResult(false) } else { lock.count = 0; - lock.generation_id += 1; + lock.generation_id = lock.generation_id.wrapping_add(1); self.cvar.notify_all(); BarrierWaitResult(true) } |
