We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
let
const let
1 parent dcb444a commit 2af92bbCopy full SHA for 2af92bb
compiler/rustc_parse/src/parser/item.rs
@@ -1124,6 +1124,16 @@ impl<'a> Parser<'a> {
1124
Applicability::MaybeIncorrect,
1125
)
1126
.emit();
1127
+ } else if self.eat_keyword(kw::Let) {
1128
+ let span = self.prev_token.span;
1129
+ self.struct_span_err(const_span.to(span), "`const` and `let` are mutually exclusive")
1130
+ .span_suggestion(
1131
+ const_span.to(span),
1132
+ "remove `let`",
1133
+ "const",
1134
+ Applicability::MaybeIncorrect,
1135
+ )
1136
+ .emit();
1137
}
1138
1139
0 commit comments