Skip to content

Commit 7698807

Browse files
committed
Fix clippy and comment
1 parent 8c5dafd commit 7698807

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

compiler/rustc_resolve/src/late.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
22682268

22692269
ExprKind::Break(None, Some(ref e)) => {
22702270
// We use this instead of `visit::walk_expr` to keep the parent expr around for
2271-
// better
2271+
// better diagnostics.
22722272
self.resolve_expr(e, Some(&expr));
22732273
}
22742274

src/tools/clippy/clippy_lints/src/needless_continue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ where
221221
{
222222
if let ast::ExprKind::While(_, loop_block, label)
223223
| ast::ExprKind::ForLoop(_, _, loop_block, label)
224-
| ast::ExprKind::Loop(loop_block, label, _) = &expr.kind
224+
| ast::ExprKind::Loop(loop_block, label, ..) = &expr.kind
225225
{
226226
func(loop_block, label.as_ref());
227227
}

src/tools/clippy/clippy_lints/src/utils/author.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
317317
self.current = cast_pat;
318318
self.visit_expr(expr);
319319
},
320-
ExprKind::Loop(ref body, _, desugaring) => {
320+
ExprKind::Loop(ref body, _, desugaring, _) => {
321321
let body_pat = self.next("body");
322322
let des = loop_desugaring_name(desugaring);
323323
let label_pat = self.next("label");

src/tools/clippy/clippy_lints/src/utils/higher.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub fn for_loop<'tcx>(
142142
if let hir::ExprKind::Match(ref iterexpr, ref arms, hir::MatchSource::ForLoopDesugar) = expr.kind;
143143
if let hir::ExprKind::Call(_, ref iterargs) = iterexpr.kind;
144144
if iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none();
145-
if let hir::ExprKind::Loop(ref block, _, _) = arms[0].body.kind;
145+
if let hir::ExprKind::Loop(ref block, ..) = arms[0].body.kind;
146146
if block.expr.is_none();
147147
if let [ _, _, ref let_stmt, ref body ] = *block.stmts;
148148
if let hir::StmtKind::Local(ref local) = let_stmt.kind;
@@ -158,7 +158,7 @@ pub fn for_loop<'tcx>(
158158
/// `while cond { body }` becomes `(cond, body)`.
159159
pub fn while_loop<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> Option<(&'tcx hir::Expr<'tcx>, &'tcx hir::Expr<'tcx>)> {
160160
if_chain! {
161-
if let hir::ExprKind::Loop(block, _, hir::LoopSource::While) = &expr.kind;
161+
if let hir::ExprKind::Loop(block, _, hir::LoopSource::While, _) = &expr.kind;
162162
if let hir::Block { expr: Some(expr), .. } = &**block;
163163
if let hir::ExprKind::Match(cond, arms, hir::MatchSource::WhileDesugar) = &expr.kind;
164164
if let hir::ExprKind::DropTemps(cond) = &cond.kind;

src/tools/clippy/clippy_lints/src/utils/hir_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> {
123123
self.eq_expr(lc, rc) && self.eq_expr(&**lt, &**rt) && both(le, re, |l, r| self.eq_expr(l, r))
124124
},
125125
(&ExprKind::Lit(ref l), &ExprKind::Lit(ref r)) => l.node == r.node,
126-
(&ExprKind::Loop(ref lb, ref ll, ref lls), &ExprKind::Loop(ref rb, ref rl, ref rls)) => {
126+
(&ExprKind::Loop(ref lb, ref ll, ref lls, _), &ExprKind::Loop(ref rb, ref rl, ref rls, _)) => {
127127
lls == rls && self.eq_block(lb, rb) && both(ll, rl, |l, r| l.ident.name == r.ident.name)
128128
},
129129
(&ExprKind::Match(ref le, ref la, ref ls), &ExprKind::Match(ref re, ref ra, ref rs)) => {
@@ -560,7 +560,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
560560
ExprKind::Lit(ref l) => {
561561
l.node.hash(&mut self.s);
562562
},
563-
ExprKind::Loop(ref b, ref i, _) => {
563+
ExprKind::Loop(ref b, ref i, ..) => {
564564
self.hash_block(b);
565565
if let Some(i) = *i {
566566
self.hash_name(i.ident.name);

0 commit comments

Comments
 (0)