about summary refs log tree commit diff
path: root/compiler/rustc_data_structures
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_data_structures')
-rw-r--r--compiler/rustc_data_structures/src/sync.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs
index df8285cc729..96dc187611d 100644
--- a/compiler/rustc_data_structures/src/sync.rs
+++ b/compiler/rustc_data_structures/src/sync.rs
@@ -143,19 +143,10 @@ cfg_if! {
                 self.0.set(val);
                 result
             }
-            pub fn fetch_update(
-                &self,
-                _order_set: Ordering,
-                _order_get: Ordering,
-                mut f: impl FnMut(bool) -> Option<bool>,
-            ) -> Result<bool, bool> {
-                let prev = self.0.get();
-                if let Some(next) = f(prev) {
-                    self.0.set(next);
-                    Ok(prev)
-                } else {
-                    Err(prev)
-                }
+            pub fn fetch_and(&self, val: bool, _: Ordering) -> bool {
+                let result = self.0.get() & val;
+                self.0.set(val);
+                result
             }
         }