Stringify non-shorthand visibility correctly
This commit is contained in:
parent
34a6cae28e
commit
be5672ecb2
6 changed files with 18 additions and 9 deletions
|
@ -1295,7 +1295,11 @@ impl<'a> Parser<'a> {
|
|||
self.bump(); // `in`
|
||||
let path = self.parse_path(PathStyle::Mod)?; // `path`
|
||||
self.expect(&token::CloseDelim(Delimiter::Parenthesis))?; // `)`
|
||||
let vis = VisibilityKind::Restricted { path: P(path), id: ast::DUMMY_NODE_ID };
|
||||
let vis = VisibilityKind::Restricted {
|
||||
path: P(path),
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
shorthand: false,
|
||||
};
|
||||
return Ok(Visibility {
|
||||
span: lo.to(self.prev_token.span),
|
||||
kind: vis,
|
||||
|
@ -1308,7 +1312,11 @@ impl<'a> Parser<'a> {
|
|||
self.bump(); // `(`
|
||||
let path = self.parse_path(PathStyle::Mod)?; // `crate`/`super`/`self`
|
||||
self.expect(&token::CloseDelim(Delimiter::Parenthesis))?; // `)`
|
||||
let vis = VisibilityKind::Restricted { path: P(path), id: ast::DUMMY_NODE_ID };
|
||||
let vis = VisibilityKind::Restricted {
|
||||
path: P(path),
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
shorthand: true,
|
||||
};
|
||||
return Ok(Visibility {
|
||||
span: lo.to(self.prev_token.span),
|
||||
kind: vis,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue