- is_unsafe_block(block) || block.stmts.len() > 1 || context.inside_macro
- || block_contains_comment(block, context.codemap) || prefix.contains('\n')
+ is_unsafe_block(block)
+ || block.stmts.len() > 1
+ || block_contains_comment(block, context.source_map)
+ || prefix.contains('\n')
+}
+
+fn veto_block(e: &ast::Expr) -> bool {
+ match e.node {
+ ast::ExprKind::Call(..)
+ | ast::ExprKind::Binary(..)
+ | ast::ExprKind::Cast(..)
+ | ast::ExprKind::Type(..)
+ | ast::ExprKind::Assign(..)
+ | ast::ExprKind::AssignOp(..)
+ | ast::ExprKind::Field(..)
+ | ast::ExprKind::Index(..)
+ | ast::ExprKind::Range(..)
+ | ast::ExprKind::Try(..) => true,
+ _ => false,
+ }