about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-06-06 12:03:29 +0000
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-06-06 18:52:47 +0000
commit5593e7e2ba2c04c6ded2d01859d5f762bb4e043d (patch)
treeed8d2b465653e9717e033102d344844ac173e651 /compiler
parente4106065bf1bb515935d5d024e8d9c86454e2b22 (diff)
downloadrust-5593e7e2ba2c04c6ded2d01859d5f762bb4e043d.tar.gz
rust-5593e7e2ba2c04c6ded2d01859d5f762bb4e043d.zip
Avoid duplicate type sanitization of local decls
The type of the local decl is already sanitized in `visit_local_decl`.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_borrowck/src/type_check/mod.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs
index 908ff3da5ca..31e20d7e709 100644
--- a/compiler/rustc_borrowck/src/type_check/mod.rs
+++ b/compiler/rustc_borrowck/src/type_check/mod.rs
@@ -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);
     }
 }