Attach TokenStream
to ast::Visibility
A `Visibility` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
This commit is contained in:
parent
55082ce413
commit
c1011165e6
22 changed files with 120 additions and 50 deletions
|
@ -198,13 +198,13 @@ impl<'a> AstValidator<'a> {
|
|||
}
|
||||
|
||||
fn invalid_visibility(&self, vis: &Visibility, note: Option<&str>) {
|
||||
if let VisibilityKind::Inherited = vis.node {
|
||||
if let VisibilityKind::Inherited = vis.kind {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut err =
|
||||
struct_span_err!(self.session, vis.span, E0449, "unnecessary visibility qualifier");
|
||||
if vis.node.is_pub() {
|
||||
if vis.kind.is_pub() {
|
||||
err.span_label(vis.span, "`pub` not permitted here because it's implied");
|
||||
}
|
||||
if let Some(note) = note {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue