Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more span suggestions #89391

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
Milo123459 committed Dec 31, 2021

Verified

This commit was signed with the committer’s verified signature. The key has expired.
sebastienrousseau Sebastien Rousseau
commit 1480e98cc39d3c5783fee53ddfecb42568c3febe
7 changes: 6 additions & 1 deletion compiler/rustc_typeck/src/check/pat.rs
Original file line number Diff line number Diff line change
@@ -1435,7 +1435,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
)
.span_label(span, format!("multiple uses of `{}` in pattern", ident))
.span_label(other_field, format!("first use of `{}`", ident))
.span_suggestion(span, "consider removing one usage of", ident.to_string(), rustc_errors::Applicability::MachineApplicable)
.span_suggestion(
span,
"consider removing one usage of",
ident.to_string(),
rustc_errors::Applicability::MaybeIncorrect,
)
.emit();
}