lint: port box pointers diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
588977b350
commit
d433c9a446
2 changed files with 3 additions and 1 deletions
|
@ -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}
|
||||||
|
|
|
@ -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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue