From f204b7ec767b6bcd3b4e0e5893e2108f2d13e031 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sat, 16 Feb 2019 22:40:44 +0100 Subject: [PATCH] Fix ICE #3717 Restore the old `TypeckTables` in visit_body after walking the body --- clippy_lints/src/types.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 79e9f4f27d24..227b10cd29a6 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -2239,8 +2239,10 @@ impl<'a, 'b, 'tcx: 'a + 'b> ImplicitHasherConstructorVisitor<'a, 'b, 'tcx> { impl<'a, 'b, 'tcx: 'a + 'b> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 'tcx> { fn visit_body(&mut self, body: &'tcx Body) { + let prev_body = self.body; self.body = self.cx.tcx.body_tables(body.id()); walk_body(self, body); + self.body = prev_body; } fn visit_expr(&mut self, e: &'tcx Expr) {