aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2020-11-28 21:14:26 +0000
committerPhilip Herron <philip.herron@embecosm.com>2020-11-28 21:14:26 +0000
commitb27c4a4986fb240efafbf263952e5f474bcef2f1 (patch)
tree59df1fc63fbb7535f34efeb91019495e2d8b66af
parented452249584e272359faf723e831e9d91f9a511c (diff)
downloadgcc-b27c4a4986fb240efafbf263952e5f474bcef2f1.zip
gcc-b27c4a4986fb240efafbf263952e5f474bcef2f1.tar.gz
gcc-b27c4a4986fb240efafbf263952e5f474bcef2f1.tar.bz2
No need to declare Type as inferedType when it is already defined
In the case where there is no init_expression for a variable declaration and the type was defined on the name we dont need to then assign that the variable was infered.
-rw-r--r--gcc/rust/analysis/rust-type-resolution.cc7
1 files changed, 0 insertions, 7 deletions
diff --git a/gcc/rust/analysis/rust-type-resolution.cc b/gcc/rust/analysis/rust-type-resolution.cc
index 9179b0c..707e0e8 100644
--- a/gcc/rust/analysis/rust-type-resolution.cc
+++ b/gcc/rust/analysis/rust-type-resolution.cc
@@ -1048,13 +1048,6 @@ TypeResolution::visit (AST::LetStmt &stmt)
return;
}
}
- else if (stmt.has_type () && !stmt.has_init_expr ())
- {
- inferedType = stmt.type.get ();
- }
-
- // TODO check we know what the type is in the scope requires the builtins to
- // be defined at the constructor
// ensure the decl has the type set for compilation later on
if (!stmt.has_type ())