lint: port test items diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
3a498a7436
commit
10f2d3f566
2 changed files with 3 additions and 1 deletions
|
@ -371,3 +371,5 @@ lint-builtin-trivial-bounds = {$predicate_kind_name} bound {$predicate} does not
|
||||||
|
|
||||||
lint-builtin-ellipsis-inclusive-range-patterns = `...` range patterns are deprecated
|
lint-builtin-ellipsis-inclusive-range-patterns = `...` range patterns are deprecated
|
||||||
.suggestion = use `..=` for an inclusive range
|
.suggestion = use `..=` for an inclusive range
|
||||||
|
|
||||||
|
lint-builtin-unnameable-test-items = cannot test inner items
|
||||||
|
|
|
@ -1915,7 +1915,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnameableTestItems {
|
||||||
let attrs = cx.tcx.hir().attrs(it.hir_id());
|
let attrs = cx.tcx.hir().attrs(it.hir_id());
|
||||||
if let Some(attr) = cx.sess().find_by_name(attrs, sym::rustc_test_marker) {
|
if let Some(attr) = cx.sess().find_by_name(attrs, sym::rustc_test_marker) {
|
||||||
cx.struct_span_lint(UNNAMEABLE_TEST_ITEMS, attr.span, |lint| {
|
cx.struct_span_lint(UNNAMEABLE_TEST_ITEMS, attr.span, |lint| {
|
||||||
lint.build("cannot test inner items").emit();
|
lint.build(fluent::lint::builtin_unnameable_test_items).emit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue