lint: port missing copy impl diagnostics

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-06-28 11:23:11 +01:00
parent 82bd2c23e5
commit 28655bc955
2 changed files with 3 additions and 5 deletions

View File

@ -326,3 +326,5 @@ lint-builtin-decl-unsafe-method = declaration of an `unsafe` method
lint-builtin-impl-unsafe-method = implementation of an `unsafe` method lint-builtin-impl-unsafe-method = implementation of an `unsafe` method
lint-builtin-missing-doc = missing documentation for {$article} {$desc} lint-builtin-missing-doc = missing documentation for {$article} {$desc}
lint-builtin-missing-copy-impl = type could implement `Copy`; consider adding `impl Copy`

View File

@ -781,11 +781,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
.is_ok() .is_ok()
{ {
cx.struct_span_lint(MISSING_COPY_IMPLEMENTATIONS, item.span, |lint| { cx.struct_span_lint(MISSING_COPY_IMPLEMENTATIONS, item.span, |lint| {
lint.build( lint.build(fluent::lint::builtin_missing_copy_impl).emit();
"type could implement `Copy`; consider adding `impl \
Copy`",
)
.emit();
}) })
} }
} }