Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTES
This commit is contained in:
parent
785c83015c
commit
d11a9702ab
6 changed files with 84 additions and 69 deletions
|
@ -1187,15 +1187,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
|||
|
||||
sym::masked => self.check_doc_masked(attr, meta, hir_id, target),
|
||||
|
||||
// no_default_passes: deprecated
|
||||
// passes: deprecated
|
||||
// plugins: removed, but rustdoc warns about it itself
|
||||
sym::cfg
|
||||
| sym::hidden
|
||||
| sym::no_default_passes
|
||||
| sym::notable_trait
|
||||
| sym::passes
|
||||
| sym::plugins => {}
|
||||
sym::cfg | sym::hidden | sym::notable_trait => {}
|
||||
|
||||
sym::rust_logo => {
|
||||
if self.check_attr_crate_level(attr, meta, hir_id)
|
||||
|
@ -1244,6 +1236,22 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
|||
sugg: (attr.meta().unwrap().span, applicability),
|
||||
},
|
||||
);
|
||||
} else if i_meta.has_name(sym::passes)
|
||||
|| i_meta.has_name(sym::no_default_passes)
|
||||
{
|
||||
self.tcx.emit_node_span_lint(
|
||||
INVALID_DOC_ATTRIBUTES,
|
||||
hir_id,
|
||||
i_meta.span,
|
||||
errors::DocTestUnknownPasses { path, span: i_meta.span },
|
||||
);
|
||||
} else if i_meta.has_name(sym::plugins) {
|
||||
self.tcx.emit_node_span_lint(
|
||||
INVALID_DOC_ATTRIBUTES,
|
||||
hir_id,
|
||||
i_meta.span,
|
||||
errors::DocTestUnknownPlugins { path, span: i_meta.span },
|
||||
);
|
||||
} else {
|
||||
self.tcx.emit_node_span_lint(
|
||||
INVALID_DOC_ATTRIBUTES,
|
||||
|
|
|
@ -317,6 +317,27 @@ pub(crate) struct DocTestUnknownSpotlight {
|
|||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(passes_doc_test_unknown_passes)]
|
||||
#[note]
|
||||
#[help]
|
||||
#[note(passes_no_op_note)]
|
||||
pub(crate) struct DocTestUnknownPasses {
|
||||
pub path: String,
|
||||
#[label]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(passes_doc_test_unknown_plugins)]
|
||||
#[note]
|
||||
#[note(passes_no_op_note)]
|
||||
pub(crate) struct DocTestUnknownPlugins {
|
||||
pub path: String,
|
||||
#[label]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(passes_doc_test_unknown_include)]
|
||||
pub(crate) struct DocTestUnknownInclude {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue