Don't emit an error if the custom_code_classes_in_docs feature is disabled when its syntax is used.

This commit is contained in:
Guillaume Gomez
2023-09-17 14:52:45 +02:00
parent cdd182cbb2
commit e1294b26af
9 changed files with 144 additions and 32 deletions

View File

@@ -208,7 +208,14 @@ impl<'a, 'b> DocVisitor for CoverageCalculator<'a, 'b> {
let has_docs = !i.attrs.doc_strings.is_empty();
let mut tests = Tests { found_tests: 0 };
find_testable_code(&i.doc_value(), &mut tests, ErrorCodes::No, false, None);
find_testable_code(
&i.doc_value(),
&mut tests,
ErrorCodes::No,
false,
None,
self.ctx.tcx.features().custom_code_classes_in_docs,
);
let has_doc_example = tests.found_tests != 0;
let hir_id = DocContext::as_local_hir_id(self.ctx.tcx, i.item_id).unwrap();