1
Fork 0

lint: port box pointers diagnostics

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-06-28 10:56:01 +01:00
parent 588977b350
commit d433c9a446
2 changed files with 3 additions and 1 deletions

View file

@ -289,3 +289,5 @@ lint-unused-allocation-mut = unnecessary allocation, use `&mut` instead
lint-builtin-while-true = denote infinite loops with `loop {"{"} ... {"}"}` lint-builtin-while-true = denote infinite loops with `loop {"{"} ... {"}"}`
.suggestion = use `loop` .suggestion = use `loop`
lint-builtin-box-pointers = type uses owned (Box type) pointers: {$ty}

View file

@ -155,7 +155,7 @@ impl BoxPointers {
if let GenericArgKind::Type(leaf_ty) = leaf.unpack() { if let GenericArgKind::Type(leaf_ty) = leaf.unpack() {
if leaf_ty.is_box() { if leaf_ty.is_box() {
cx.struct_span_lint(BOX_POINTERS, span, |lint| { cx.struct_span_lint(BOX_POINTERS, span, |lint| {
lint.build(&format!("type uses owned (Box type) pointers: {}", ty)).emit(); lint.build(fluent::lint::builtin_box_pointers).set_arg("ty", ty).emit();
}); });
} }
} }