1
Fork 0

Add PatKind::Err

This commit is contained in:
Lieselotte 2024-01-17 03:14:16 +01:00
parent 6ed31aba1a
commit 7889e99b55
No known key found for this signature in database
GPG key ID: 43A6A32F83A6F9B1
23 changed files with 66 additions and 24 deletions

View file

@ -1166,7 +1166,7 @@ impl EarlyLintPass for UnusedParens {
// Do not lint on `(..)` as that will result in the other arms being useless.
Paren(_)
// The other cases do not contain sub-patterns.
| Wild | Never | Rest | Lit(..) | MacCall(..) | Range(..) | Ident(.., None) | Path(..) => {},
| Wild | Never | Rest | Lit(..) | MacCall(..) | Range(..) | Ident(.., None) | Path(..) | Err(_) => {},
// These are list-like patterns; parens can always be removed.
TupleStruct(_, _, ps) | Tuple(ps) | Slice(ps) | Or(ps) => for p in ps {
self.check_unused_parens_pat(cx, p, false, false, keep_space);