Adding suggestion for E0530

This commit is contained in:
Obei Sideg 2022-07-07 12:45:08 +03:00
parent e78e747f53
commit 51504dbf01

View File

@ -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);