diff options
| author | bors <bors@rust-lang.org> | 2023-05-31 13:47:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-31 13:47:36 +0000 |
| commit | ad8304a0d5280de30856b39c19df7b306957e878 (patch) | |
| tree | 4c5167ddcf79cb528d67dcee35082adb7e38f980 /compiler/rustc_data_structures/src | |
| parent | e4f7ad8e68206fa54372535b5c04d7ddbaea43be (diff) | |
| parent | 52bd82f522c4f3d9bd0dc534c06169285afbc23b (diff) | |
| download | rust-ad8304a0d5280de30856b39c19df7b306957e878.tar.gz rust-ad8304a0d5280de30856b39c19df7b306957e878.zip | |
Auto merge of #111076 - notriddle:notriddle/silence-private-dep-trait-impl-suggestions, r=cjgillot
diagnostics: exclude indirect private deps from trait impl suggest Fixes #88696
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/sync.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index 6c3197d8ec2..25a08237346 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -139,9 +139,14 @@ cfg_if! { impl Atomic<bool> { pub fn fetch_or(&self, val: bool, _: Ordering) -> bool { - let result = self.0.get() | val; - self.0.set(val); - result + let old = self.0.get(); + self.0.set(val | old); + old + } + pub fn fetch_and(&self, val: bool, _: Ordering) -> bool { + let old = self.0.get(); + self.0.set(val & old); + old } } |
