mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
simplify match stmt
This commit is contained in:
parent
a17dd36084
commit
c21e25c262
@ -289,11 +289,7 @@ impl<'a> AstValidator<'a> {
|
||||
match expr.kind {
|
||||
ExprKind::Lit(..) | ExprKind::Err => {}
|
||||
ExprKind::Path(..) if allow_paths => {}
|
||||
ExprKind::Unary(UnOp::Neg, ref inner)
|
||||
if match inner.kind {
|
||||
ExprKind::Lit(_) => true,
|
||||
_ => false,
|
||||
} => {}
|
||||
ExprKind::Unary(UnOp::Neg, ref inner) if matches!(inner.kind, ExprKind::Lit(_)) => {}
|
||||
_ => self.err_handler().span_err(
|
||||
expr.span,
|
||||
"arbitrary expressions aren't allowed \
|
||||
|
Loading…
Reference in New Issue
Block a user