Skip to content

Commit 3217799

Browse files
committed
Fix missing field in ExprKind::Yield
Rustup rust-lang/rust#61941
1 parent 97f8caa commit 3217799

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

clippy_lints/src/loops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ fn never_loop_expr(expr: &Expr, main_loop_id: HirId) -> NeverLoopResult {
736736
}
737737
},
738738
ExprKind::Struct(_, _, None)
739-
| ExprKind::Yield(_)
739+
| ExprKind::Yield(_, _)
740740
| ExprKind::Closure(_, _, _, _, _)
741741
| ExprKind::InlineAsm(_, _, _)
742742
| ExprKind::Path(_)

clippy_lints/src/utils/author.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
377377
println!("Closure(ref capture_clause, ref func, _, _, _) = {};", current);
378378
println!(" // unimplemented: `ExprKind::Closure` is not further destructured at the moment");
379379
},
380-
ExprKind::Yield(ref sub) => {
380+
ExprKind::Yield(ref sub, _) => {
381381
let sub_pat = self.next("sub");
382382
println!("Yield(ref sub) = {};", current);
383383
self.current = sub_pat;

clippy_lints/src/utils/hir_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
436436
self.hash_expr(&*j);
437437
}
438438
},
439-
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e) => {
439+
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e, _) => {
440440
self.hash_expr(e);
441441
},
442442
ExprKind::Call(ref fun, ref args) => {

clippy_lints/src/utils/inspector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
227227
println!("{}Closure", ind);
228228
println!("{}clause: {:?}", ind, clause);
229229
},
230-
hir::ExprKind::Yield(ref sub) => {
230+
hir::ExprKind::Yield(ref sub, _) => {
231231
println!("{}Yield", ind);
232232
print_expr(cx, sub, indent + 1);
233233
},

0 commit comments

Comments
 (0)