Feature gate the rustdoc::missing_doc_code_examples lint

This commit is contained in:
Wim Looman
2022-09-12 20:10:35 +02:00
parent fd1a399c4f
commit 72cf46aa72
16 changed files with 93 additions and 37 deletions

View File

@@ -117,7 +117,7 @@ pub(crate) fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item
find_testable_code(dox, &mut tests, ErrorCodes::No, false, None);
if tests.found_tests == 0 && cx.tcx.sess.is_nightly_build() {
if tests.found_tests == 0 && cx.tcx.features().rustdoc_missing_doc_code_examples {
if should_have_doc_example(cx, item) {
debug!("reporting error for {:?} (hir_id={:?})", item, hir_id);
let sp = item.attr_span(cx.tcx);