Introduce the #[diagnostic]
attribute namespace
Co-authored-by: est31 <est31@users.noreply.github.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
This commit is contained in:
parent
d150dbb067
commit
5b576665e5
15 changed files with 202 additions and 4 deletions
|
@ -218,6 +218,19 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
|||
}
|
||||
}
|
||||
}
|
||||
if !attr.is_doc_comment()
|
||||
&& attr.get_normal_item().path.segments.len() == 2
|
||||
&& attr.get_normal_item().path.segments[0].ident.name == sym::diagnostic
|
||||
&& !self.features.diagnostic_namespace
|
||||
{
|
||||
let msg = "`#[diagnostic]` attribute name space is experimental";
|
||||
gate_feature_post!(
|
||||
self,
|
||||
diagnostic_namespace,
|
||||
attr.get_normal_item().path.segments[0].ident.span,
|
||||
msg
|
||||
);
|
||||
}
|
||||
|
||||
// Emit errors for non-staged-api crates.
|
||||
if !self.features.staged_api {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue