diff options
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 0f58206eee9..35155175886 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -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); |
