X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_typeck%2Fsrc%2Fcollect.rs;h=41c8a37a71a6d03a1c7dfd7c7cab5a0545cb1e28;hb=1591dcb659917de87254297073b078b9ade56612;hp=e1fef84d9d9298955fddc268785efe5369f0fc33;hpb=d83dd85253c70949155cd92694991475220b5e55;p=rust.git diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index e1fef84d9d9..41c8a37a71a 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -295,7 +295,9 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) { if let hir::ExprKind::Closure(..) = expr.kind { let def_id = self.tcx.hir().local_def_id(expr.hir_id); self.tcx.ensure().generics_of(def_id); - self.tcx.ensure().type_of(def_id); + // We do not call `type_of` for closures here as that + // depends on typecheck and would therefore hide + // any further errors in case one typeck fails. } intravisit::walk_expr(self, expr); }