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:
parent
b70cc6422c
commit
874cd08e23
3 changed files with 56 additions and 0 deletions
|
@ -2376,7 +2376,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