Skip to content

Commit 28655bc

Browse files
committed
lint: port missing copy impl diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
1 parent 82bd2c2 commit 28655bc

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

compiler/rustc_error_messages/locales/en-US/lint.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,5 @@ lint-builtin-decl-unsafe-method = declaration of an `unsafe` method
326326
lint-builtin-impl-unsafe-method = implementation of an `unsafe` method
327327
328328
lint-builtin-missing-doc = missing documentation for {$article} {$desc}
329+
330+
lint-builtin-missing-copy-impl = type could implement `Copy`; consider adding `impl Copy`

compiler/rustc_lint/src/builtin.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
781781
.is_ok()
782782
{
783783
cx.struct_span_lint(MISSING_COPY_IMPLEMENTATIONS, item.span, |lint| {
784-
lint.build(
785-
"type could implement `Copy`; consider adding `impl \
786-
Copy`",
787-
)
788-
.emit();
784+
lint.build(fluent::lint::builtin_missing_copy_impl).emit();
789785
})
790786
}
791787
}

0 commit comments

Comments
 (0)