Skip to content

Commit fd6efcf

Browse files
authored
Rollup merge of #112350 - Nilstrieb:borrow-me-some-cleanups, r=compiler-errors
Avoid duplicate type sanitization of local decls in borrowck The type of the local decl is already sanitized in `visit_local_decl`.
2 parents 38ddff5 + 5593e7e commit fd6efcf

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)