lint: port anonymous parameter diagnostics

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-06-28 11:31:44 +01:00
parent 284ec37810
commit 18a48c1d6c
2 changed files with 11 additions and 12 deletions

View file

@ -331,3 +331,6 @@ lint-builtin-missing-copy-impl = type could implement `Copy`; consider adding `i
lint-builtin-missing-debug-impl = lint-builtin-missing-debug-impl =
type does not implement `{$debug}`; consider adding `#[derive(Debug)]` or a manual implementation type does not implement `{$debug}`; consider adding `#[derive(Debug)]` or a manual implementation
lint-builtin-anonymous-params = anonymous parameters are deprecated and will be removed in the next edition
.suggestion = try naming the parameter or explicitly ignoring it

View file

@ -937,14 +937,10 @@ impl EarlyLintPass for AnonymousParameters {
("<type>", Applicability::HasPlaceholders) ("<type>", Applicability::HasPlaceholders)
}; };
lint.build( lint.build(fluent::lint::builtin_anonymous_params)
"anonymous parameters are deprecated and will be \
removed in the next edition",
)
.span_suggestion( .span_suggestion(
arg.pat.span, arg.pat.span,
"try naming the parameter or explicitly \ fluent::lint::suggestion,
ignoring it",
format!("_: {}", ty_snip), format!("_: {}", ty_snip),
appl, appl,
) )