lint: port test items diagnostics

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

View File

@ -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
.suggestion = use `..=` for an inclusive range
lint-builtin-unnameable-test-items = cannot test inner items

View File

@ -1915,7 +1915,7 @@ fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) {
let attrs = cx.tcx.hir().attrs(it.hir_id());
if let Some(attr) = cx.sess().find_by_name(attrs, sym::rustc_test_marker) {
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();
});
}
}