]> git.lizzy.rs Git - rust.git/blobdiff - src/expr.rs
Update rustc-ap-* -> 148
[rust.git] / src / expr.rs
index 2f5e53ef06275dbc8d7bddfdd2b9ed9c3a5e7bc4..4a877ad2487d451c0d527db263ed365555de1008 100644 (file)
@@ -2173,3 +2173,15 @@ fn can_be_overflowed(&self, _: &RewriteContext, _: usize) -> bool {
         false
     }
 }
+
+pub fn is_method_call(expr: &ast::Expr) -> bool {
+    match expr.node {
+        ast::ExprKind::MethodCall(..) => true,
+        ast::ExprKind::AddrOf(_, ref expr)
+        | ast::ExprKind::Box(ref expr)
+        | ast::ExprKind::Cast(ref expr, _)
+        | ast::ExprKind::Try(ref expr)
+        | ast::ExprKind::Unary(_, ref expr) => is_method_call(expr),
+        _ => false,
+    }
+}