about summary refs log tree commit diff
path: root/compiler/rustc_error_messages
diff options
context:
space:
mode:
authorEdward Shen <code@eddie.sh>2023-01-23 20:31:45 -0800
committerEdward Shen <xes@meta.com>2023-01-23 20:33:04 -0800
commita8b77cfe5464e29b25389593ced9d080bf0dd6c8 (patch)
tree2fae43b147645668da9ce11c1c52f7652bec936d /compiler/rustc_error_messages
parentc8e6a9e8b6251bbc8276cb78cabe1998deecbed7 (diff)
Add suggestion to remove if in let...else block
Adds an additional hint to failures where we encounter an else keyword
while we're parsing an if-let block.

This is likely that the user has accidentally mixed if-let and let...else
together.
Diffstat (limited to 'compiler/rustc_error_messages')
-rw-r--r--compiler/rustc_error_messages/locales/en-US/parse.ftl1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_error_messages/locales/en-US/parse.ftl b/compiler/rustc_error_messages/locales/en-US/parse.ftl
index 8f063f5082c..a3e2002da78 100644
--- a/compiler/rustc_error_messages/locales/en-US/parse.ftl
+++ b/compiler/rustc_error_messages/locales/en-US/parse.ftl
@@ -238,6 +238,7 @@ parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive
 
 parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else`
 parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed
+parse_extra_if_in_let_else = remove the `if` if you meant to write a `let...else` statement
 
 parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable
     .suggestion = initialize the variable