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`.
This commit is contained in:
Matthias Krüger 2023-06-06 22:00:20 +02:00 committed by GitHub
commit fd6efcf960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -477,9 +477,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
fn visit_body(&mut self, body: &Body<'tcx>) {
self.sanitize_type(&"return type", body.return_ty());
for local_decl in &body.local_decls {
self.sanitize_type(local_decl, local_decl.ty);
}
// The types of local_decls are checked above which is called in super_body.
self.super_body(body);
}
}