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

Adding suggestion for E0530 #99008

Merged
merged 4 commits into from
Jul 9, 2022
Merged
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
Next Next commit
Adding suggestion for E0530
  • Loading branch information
obeis committed Jul 7, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 51504dbf01aa7cebe99cd0527f908d4d8ccae1a5
7 changes: 7 additions & 0 deletions compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -915,6 +915,13 @@ impl<'a> Resolver<'a> {
span,
format!("cannot be named the same as {} {}", article, shadowed_binding_descr),
);
err.span_suggestion(
span,
"try specify the pattern arguments",
format!("{}(..)", name),
Applicability::Unspecified,
)
.emit();
let msg =
format!("the {} `{}` is {} here", shadowed_binding_descr, name, participle);
err.span_label(shadowed_binding_span, msg);