feature gate doc(primitive)

This commit is contained in:
Joshua Nelson 2021-07-10 22:06:10 -04:00
parent 2bd17c1d43
commit 03df65497e
9 changed files with 49 additions and 7 deletions

View file

@ -794,9 +794,24 @@ impl CheckAttrVisitor<'tcx> {
| sym::notable_trait
| sym::passes
| sym::plugins
| sym::primitive
| sym::test => {}
sym::primitive => {
if !self.tcx.features().doc_primitive {
self.tcx.struct_span_lint_hir(
INVALID_DOC_ATTRIBUTES,
hir_id,
i_meta.span,
|lint| {
let mut diag = lint.build(
"`doc(primitive)` should never have been stable",
);
diag.emit();
},
);
}
}
_ => {
self.tcx.struct_span_lint_hir(
INVALID_DOC_ATTRIBUTES,