Skip to content

Commit f204b7e

Browse files
committed
Fix ICE #3717
Restore the old `TypeckTables` in visit_body after walking the body
1 parent 32ee306 commit f204b7e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_lints/src/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,8 +2239,10 @@ impl<'a, 'b, 'tcx: 'a + 'b> ImplicitHasherConstructorVisitor<'a, 'b, 'tcx> {
22392239

22402240
impl<'a, 'b, 'tcx: 'a + 'b> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 'tcx> {
22412241
fn visit_body(&mut self, body: &'tcx Body) {
2242+
let prev_body = self.body;
22422243
self.body = self.cx.tcx.body_tables(body.id());
22432244
walk_body(self, body);
2245+
self.body = prev_body;
22442246
}
22452247

22462248
fn visit_expr(&mut self, e: &'tcx Expr) {

0 commit comments

Comments
 (0)