1
Fork 0

Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov

or-patterns: disallow in `let` bindings

~~Blocked on https://github.com/rust-lang/rust/pull/81869~~

Disallows top-level or-patterns before type ascription. We want to reserve this syntactic space for possible future generalized type ascription.

r? ``@petrochenkov``
This commit is contained in:
Mara Bos 2021-03-09 09:05:20 +00:00 committed by GitHub
commit 0d97f9b22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 605 additions and 358 deletions

View file

@ -872,7 +872,7 @@ impl EarlyLintPass for UnusedParens {
fn check_stmt(&mut self, cx: &EarlyContext<'_>, s: &ast::Stmt) {
if let StmtKind::Local(ref local) = s.kind {
self.check_unused_parens_pat(cx, &local.pat, false, false);
self.check_unused_parens_pat(cx, &local.pat, true, false);
}
<Self as UnusedDelimLint>::check_stmt(self, cx, s)