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
|
@ -218,7 +218,7 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
|
|||
speculative: bool,
|
||||
) -> Result<ty::Visibility, VisResolutionError<'ast>> {
|
||||
let parent_scope = &self.parent_scope;
|
||||
match vis.node {
|
||||
match vis.kind {
|
||||
ast::VisibilityKind::Public => Ok(ty::Visibility::Public),
|
||||
ast::VisibilityKind::Crate(..) => {
|
||||
Ok(ty::Visibility::Restricted(DefId::local(CRATE_DEF_INDEX)))
|
||||
|
|
|
@ -105,7 +105,7 @@ impl<'a, 'b> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b> {
|
|||
// because this means that they were generated in some fashion by the
|
||||
// compiler and we don't need to consider them.
|
||||
if let ast::ItemKind::Use(..) = item.kind {
|
||||
if item.vis.node.is_pub() || item.span.is_dummy() {
|
||||
if item.vis.kind.is_pub() || item.span.is_dummy() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue