Rollup merge of #92402 - pr2502:while-let-typo, r=oli-obk
Suggest while let x = y when encountering while x = y Extends #75931 to also detect where the `let` might be missing from `while let` expressions.
This commit is contained in:
commit
0335b7bca9
3 changed files with 56 additions and 0 deletions
|
@ -2379,7 +2379,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
ExprKind::While(ref cond, ref block, label) => {
|
||||
self.with_resolved_label(label, expr.id, |this| {
|
||||
this.with_rib(ValueNS, NormalRibKind, |this| {
|
||||
let old = this.diagnostic_metadata.in_if_condition.replace(cond);
|
||||
this.visit_expr(cond);
|
||||
this.diagnostic_metadata.in_if_condition = old;
|
||||
this.visit_block(block);
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue