]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir/src/pat_util.rs
Rollup merge of #83683 - tblah:riscv64linux_links, r=Mark-Simulacrum
[rust.git] / compiler / rustc_hir / src / pat_util.rs
index 9e0a6aae24272a28667905eeb3c07a9402b9f861..28529affd5d5ab02b1698747ab76f91554f7790b 100644 (file)
@@ -89,26 +89,6 @@ pub fn each_binding_or_first(
         })
     }
 
-    /// Checks if the pattern contains any patterns that bind something to
-    /// an ident, e.g., `foo`, or `Foo(foo)` or `foo @ Bar(..)`.
-    pub fn contains_bindings(&self) -> bool {
-        self.satisfies(|p| matches!(p.kind, PatKind::Binding(..)))
-    }
-
-    /// Checks if the pattern satisfies the given predicate on some sub-pattern.
-    fn satisfies(&self, pred: impl Fn(&hir::Pat<'_>) -> bool) -> bool {
-        let mut satisfies = false;
-        self.walk_short(|p| {
-            if pred(p) {
-                satisfies = true;
-                false // Found one, can short circuit now.
-            } else {
-                true
-            }
-        });
-        satisfies
-    }
-
     pub fn simple_ident(&self) -> Option<Ident> {
         match self.kind {
             PatKind::Binding(