mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
fix: Missing non-exhaustive let diagnostics inside async or unsafe block
This commit is contained in:
parent
18414cdf64
commit
db24cf5a48
2 changed files with 46 additions and 2 deletions
|
@ -117,7 +117,7 @@ impl ExprValidator {
|
|||
Expr::If { .. } => {
|
||||
self.check_for_unnecessary_else(id, expr, db);
|
||||
}
|
||||
Expr::Block { .. } => {
|
||||
Expr::Block { .. } | Expr::Async { .. } | Expr::Unsafe { .. } => {
|
||||
self.validate_block(db, expr);
|
||||
}
|
||||
_ => {}
|
||||
|
@ -254,7 +254,12 @@ impl ExprValidator {
|
|||
}
|
||||
|
||||
fn validate_block(&mut self, db: &dyn HirDatabase, expr: &Expr) {
|
||||
let Expr::Block { statements, .. } = expr else { return };
|
||||
let (Expr::Block { statements, .. }
|
||||
| Expr::Async { statements, .. }
|
||||
| Expr::Unsafe { statements, .. }) = expr
|
||||
else {
|
||||
return;
|
||||
};
|
||||
let pattern_arena = Arena::new();
|
||||
let cx = MatchCheckCtx::new(self.owner.module(db.upcast()), self.owner, db);
|
||||
for stmt in &**statements {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue