feature gate doc(primitive)
This commit is contained in:
parent
2bd17c1d43
commit
03df65497e
9 changed files with 49 additions and 7 deletions
|
@ -682,6 +682,9 @@ declare_features! (
|
|||
/// Allows explicit generic arguments specification with `impl Trait` present.
|
||||
(active, explicit_generic_args_with_impl_trait, "1.56.0", Some(83701), None),
|
||||
|
||||
/// Allows using doc(primitive) without a future-incompat warning
|
||||
(active, doc_primitive, "1.56.0", Some(88070), None),
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// feature-group-end: actual feature gates
|
||||
// -------------------------------------------------------------------------
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -513,6 +513,7 @@ symbols! {
|
|||
doc_keyword,
|
||||
doc_masked,
|
||||
doc_notable_trait,
|
||||
doc_primitive,
|
||||
doc_spotlight,
|
||||
doctest,
|
||||
document_private_items,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue