diff options
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 7cca11f20bb..1bb6b899875 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -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, |
