We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a17dd36 commit c21e25cCopy full SHA for c21e25c
src/librustc_ast_passes/ast_validation.rs
@@ -289,11 +289,7 @@ impl<'a> AstValidator<'a> {
289
match expr.kind {
290
ExprKind::Lit(..) | ExprKind::Err => {}
291
ExprKind::Path(..) if allow_paths => {}
292
- ExprKind::Unary(UnOp::Neg, ref inner)
293
- if match inner.kind {
294
- ExprKind::Lit(_) => true,
295
- _ => false,
296
- } => {}
+ ExprKind::Unary(UnOp::Neg, ref inner) if matches!(inner.kind, ExprKind::Lit(_)) => {}
297
_ => self.err_handler().span_err(
298
expr.span,
299
"arbitrary expressions aren't allowed \
0 commit comments