Skip to content

Commit

Permalink
Avoid duplicate type sanitization of local decls
Browse files Browse the repository at this point in the history
The type of the local decl is already sanitized in `visit_local_decl`.
  • Loading branch information
Noratrieb committed Jun 6, 2023
1 parent e410606 commit 5593e7e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 5593e7e

Please sign in to comment.