let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE.name;
let warnings_lint_name = lint::builtin::WARNINGS.name;
let missing_docs = rustc_lint::builtin::MISSING_DOCS.name;
- let missing_doc_example = rustc_lint::builtin::MISSING_DOC_ITEM_CODE_EXAMPLE.name;
+ let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name;
// In addition to those specific lints, we also need to whitelist those given through
// command line, otherwise they'll get ignored and we don't want that.
struct LinkCollector<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>,
mod_ids: Vec<NodeId>,
+ is_nightly_build: bool,
}
impl<'a, 'tcx, 'rcx, 'cstore> LinkCollector<'a, 'tcx, 'rcx, 'cstore> {
LinkCollector {
cx,
mod_ids: Vec::new(),
+ is_nightly_build: UnstableFeatures::from_environment().is_nightly_build(),
}
}
if find_testable_code(&dox, &mut tests, ErrorCodes::No).is_ok() {
if tests.found_tests == 0 {
let mut diag = cx.tcx.struct_span_lint_node(
- lint::builtin::MISSING_DOC_ITEM_CODE_EXAMPLE,
+ lint::builtin::MISSING_DOC_CODE_EXAMPLES,
NodeId::new(0),
span_of_attrs(&item.attrs),
"Missing code example in this documentation");
look_for_tests(&cx, &dox, &item);
- if !UnstableFeatures::from_environment().is_nightly_build() {
+ if !self.is_nightly_build {
return None;
}