Stringify non-shorthand visibility correctly
This commit is contained in:
parent
34a6cae28e
commit
be5672ecb2
6 changed files with 18 additions and 9 deletions
|
@ -2602,7 +2602,7 @@ pub struct Visibility {
|
|||
#[derive(Clone, Encodable, Decodable, Debug)]
|
||||
pub enum VisibilityKind {
|
||||
Public,
|
||||
Restricted { path: P<Path>, id: NodeId },
|
||||
Restricted { path: P<Path>, id: NodeId, shorthand: bool },
|
||||
Inherited,
|
||||
}
|
||||
|
||||
|
|
|
@ -1486,7 +1486,7 @@ pub fn noop_flat_map_stmt_kind<T: MutVisitor>(
|
|||
pub fn noop_visit_vis<T: MutVisitor>(visibility: &mut Visibility, vis: &mut T) {
|
||||
match &mut visibility.kind {
|
||||
VisibilityKind::Public | VisibilityKind::Inherited => {}
|
||||
VisibilityKind::Restricted { path, id } => {
|
||||
VisibilityKind::Restricted { path, id, shorthand: _ } => {
|
||||
vis.visit_path(path);
|
||||
vis.visit_id(id);
|
||||
}
|
||||
|
|
|
@ -935,7 +935,7 @@ pub fn walk_arm<'a, V: Visitor<'a>>(visitor: &mut V, arm: &'a Arm) {
|
|||
}
|
||||
|
||||
pub fn walk_vis<'a, V: Visitor<'a>>(visitor: &mut V, vis: &'a Visibility) {
|
||||
if let VisibilityKind::Restricted { ref path, id } = vis.kind {
|
||||
if let VisibilityKind::Restricted { ref path, id, shorthand: _ } = vis.kind {
|
||||
visitor.visit_path(path, id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue