rustdoc: adopt to the new lint API

This commit is contained in:
Maybe Waffle
2022-09-16 19:07:20 +04:00
parent 7e90a41844
commit 6ecacf76bc
7 changed files with 61 additions and 78 deletions

View File

@@ -125,9 +125,8 @@ pub(crate) fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item
crate::lint::MISSING_DOC_CODE_EXAMPLES,
hir_id,
sp,
|lint| {
lint.build("missing code example in this documentation").emit();
},
"missing code example in this documentation",
|lint| lint,
);
}
} else if tests.found_tests > 0
@@ -137,9 +136,8 @@ pub(crate) fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item
crate::lint::PRIVATE_DOC_TESTS,
hir_id,
item.attr_span(cx.tcx),
|lint| {
lint.build("documentation test in private item").emit();
},
"documentation test in private item",
|lint| lint,
);
}
}