Suggest removing let
if const let
is used
This commit is contained in:
parent
dcb444af0a
commit
2af92bbf2e
@ -1124,6 +1124,16 @@ impl<'a> Parser<'a> {
|
||||
Applicability::MaybeIncorrect,
|
||||
)
|
||||
.emit();
|
||||
} else if self.eat_keyword(kw::Let) {
|
||||
let span = self.prev_token.span;
|
||||
self.struct_span_err(const_span.to(span), "`const` and `let` are mutually exclusive")
|
||||
.span_suggestion(
|
||||
const_span.to(span),
|
||||
"remove `let`",
|
||||
"const",
|
||||
Applicability::MaybeIncorrect,
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user