]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/util/classify.rs
Account for `ty::Error` when suggesting `impl Trait` or `Box<dyn Trait>`
[rust.git] / src / libsyntax / util / classify.rs
index 4456068875019fd347260ce8c7b4f7abc412be23..60422a2e573925033b2418f6b3b6cb8d7e59981f 100644 (file)
 /// isn't parsed as (if true {...} else {...} | x) | 5
 pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool {
     match e.kind {
-        ast::ExprKind::If(..) |
-        ast::ExprKind::Match(..) |
-        ast::ExprKind::Block(..) |
-        ast::ExprKind::While(..) |
-        ast::ExprKind::Loop(..) |
-        ast::ExprKind::ForLoop(..) |
-        ast::ExprKind::TryBlock(..) => false,
+        ast::ExprKind::If(..)
+        | ast::ExprKind::Match(..)
+        | ast::ExprKind::Block(..)
+        | ast::ExprKind::While(..)
+        | ast::ExprKind::Loop(..)
+        | ast::ExprKind::ForLoop(..)
+        ast::ExprKind::TryBlock(..) => false,
         _ => true,
     }
 }