about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-27 16:46:51 +0100
committerGitHub <noreply@github.com>2019-10-27 16:46:51 +0100
commita466f014b50a49fc380e5c9d8878c937732b0fb2 (patch)
tree7893326dddb6402a6ae31255f550e222bc207149 /src/libsyntax/parse/parser
parentb7176b44a203322c834302f3b515f8c10a54f2c1 (diff)
parentb579c5a2d6948e9ff2efa81db85f7bca64f574e4 (diff)
downloadrust-a466f014b50a49fc380e5c9d8878c937732b0fb2.tar.gz
rust-a466f014b50a49fc380e5c9d8878c937732b0fb2.zip
Rollup merge of #65566 - estebank:let-expr-as-ty, r=Centril
Use heuristics to suggest assignment

When detecting a possible `=` -> `:` typo in a `let` binding, suggest
assigning instead of setting the type.

Partially address #57828.
Diffstat (limited to 'src/libsyntax/parse/parser')
-rw-r--r--src/libsyntax/parse/parser/stmt.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser/stmt.rs b/src/libsyntax/parse/parser/stmt.rs
index d54d9c4b8e9..ea7e4c05ea1 100644
--- a/src/libsyntax/parse/parser/stmt.rs
+++ b/src/libsyntax/parse/parser/stmt.rs
@@ -239,7 +239,7 @@ impl<'a> Parser<'a> {
                 err.span_suggestion_short(
                     colon_sp,
                     "use `=` if you meant to assign",
-                    "=".to_string(),
+                    " =".to_string(),
                     Applicability::MachineApplicable
                 );
                 err.emit();