Skip to content

Commit d433c9a

Browse files
committed
lint: port box pointers diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
1 parent 588977b commit d433c9a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
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
@@ -289,3 +289,5 @@ lint-unused-allocation-mut = unnecessary allocation, use `&mut` instead
289289
290290
lint-builtin-while-true = denote infinite loops with `loop {"{"} ... {"}"}`
291291
.suggestion = use `loop`
292+
293+
lint-builtin-box-pointers = type uses owned (Box type) pointers: {$ty}

compiler/rustc_lint/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl BoxPointers {
155155
if let GenericArgKind::Type(leaf_ty) = leaf.unpack() {
156156
if leaf_ty.is_box() {
157157
cx.struct_span_lint(BOX_POINTERS, span, |lint| {
158-
lint.build(&format!("type uses owned (Box type) pointers: {}", ty)).emit();
158+
lint.build(fluent::lint::builtin_box_pointers).set_arg("ty", ty).emit();
159159
});
160160
}
161161
}

0 commit comments

Comments
 (0)