Skip to content

Commit

Permalink
Fix missing field in ExprKind::Yield
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jun 19, 2019
1 parent 97f8caa commit 3217799
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ fn never_loop_expr(expr: &Expr, main_loop_id: HirId) -> NeverLoopResult {
}
},
ExprKind::Struct(_, _, None)
| ExprKind::Yield(_)
| ExprKind::Yield(_, _)
| ExprKind::Closure(_, _, _, _, _)
| ExprKind::InlineAsm(_, _, _)
| ExprKind::Path(_)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
println!("Closure(ref capture_clause, ref func, _, _, _) = {};", current);
println!(" // unimplemented: `ExprKind::Closure` is not further destructured at the moment");
},
ExprKind::Yield(ref sub) => {
ExprKind::Yield(ref sub, _) => {
let sub_pat = self.next("sub");
println!("Yield(ref sub) = {};", current);
self.current = sub_pat;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
self.hash_expr(&*j);
}
},
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e) => {
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e, _) => {
self.hash_expr(e);
},
ExprKind::Call(ref fun, ref args) => {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
println!("{}Closure", ind);
println!("{}clause: {:?}", ind, clause);
},
hir::ExprKind::Yield(ref sub) => {
hir::ExprKind::Yield(ref sub, _) => {
println!("{}Yield", ind);
print_expr(cx, sub, indent + 1);
},
Expand Down

0 comments on commit 3217799

Please sign in to comment.