1
Fork 0

Do not suggest let_else if no bindings would be introduced

This commit is contained in:
Esteban Kuber 2022-03-08 17:20:05 +00:00
parent 0d92752b8a
commit c3a998e82a
7 changed files with 1 additions and 45 deletions

View file

@ -330,7 +330,7 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
],
Applicability::HasPlaceholders,
);
if cx.tcx.sess.is_nightly_build() {
if !bindings.is_empty() && cx.tcx.sess.is_nightly_build() {
err.span_suggestion_verbose(
semi_span.shrink_to_lo(),
&format!(