Skip to content

Commit 5593e7e

Browse files
committed
Avoid duplicate type sanitization of local decls
The type of the local decl is already sanitized in `visit_local_decl`.
1 parent e410606 commit 5593e7e

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_borrowck/src/type_check

1 file changed

+1
-3
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
477477

478478
fn visit_body(&mut self, body: &Body<'tcx>) {
479479
self.sanitize_type(&"return type", body.return_ty());
480-
for local_decl in &body.local_decls {
481-
self.sanitize_type(local_decl, local_decl.ty);
482-
}
480+
// The types of local_decls are checked above which is called in super_body.
483481
self.super_body(body);
484482
}
485483
}

0 commit comments

Comments
 (0)