1
Fork 0

Lint non-meta doc attributes

E.g., `#[doc(123)]`.
This commit is contained in:
Camelid 2021-03-13 13:25:27 -08:00
parent 9613a88db5
commit 7189c05bf8
3 changed files with 37 additions and 1 deletions

View file

@ -605,6 +605,16 @@ impl CheckAttrVisitor<'tcx> {
return false;
}
}
} else {
self.tcx.struct_span_lint_hir(
INVALID_DOC_ATTRIBUTES,
hir_id,
meta.span(),
|lint| {
lint.build(&format!("unknown `doc` attribute")).emit();
},
);
return false;
}
}
}