Add a closing parenthesis to the span of Visibility::Crate
This commit is contained in:
parent
b298607864
commit
01a70c6589
1 changed files with 3 additions and 2 deletions
|
@ -5702,8 +5702,8 @@ impl<'a> Parser<'a> {
|
||||||
// `pub(crate)`
|
// `pub(crate)`
|
||||||
self.bump(); // `(`
|
self.bump(); // `(`
|
||||||
self.bump(); // `crate`
|
self.bump(); // `crate`
|
||||||
let vis = Visibility::Crate(self.prev_span, CrateSugar::PubCrate);
|
|
||||||
self.expect(&token::CloseDelim(token::Paren))?; // `)`
|
self.expect(&token::CloseDelim(token::Paren))?; // `)`
|
||||||
|
let vis = Visibility::Crate(self.prev_span, CrateSugar::PubCrate);
|
||||||
return Ok(vis)
|
return Ok(vis)
|
||||||
} else if self.look_ahead(1, |t| t.is_keyword(keywords::In)) {
|
} else if self.look_ahead(1, |t| t.is_keyword(keywords::In)) {
|
||||||
// `pub(in path)`
|
// `pub(in path)`
|
||||||
|
@ -5715,7 +5715,8 @@ impl<'a> Parser<'a> {
|
||||||
return Ok(vis)
|
return Ok(vis)
|
||||||
} else if self.look_ahead(2, |t| t == &token::CloseDelim(token::Paren)) &&
|
} else if self.look_ahead(2, |t| t == &token::CloseDelim(token::Paren)) &&
|
||||||
self.look_ahead(1, |t| t.is_keyword(keywords::Super) ||
|
self.look_ahead(1, |t| t.is_keyword(keywords::Super) ||
|
||||||
t.is_keyword(keywords::SelfValue)) {
|
t.is_keyword(keywords::SelfValue))
|
||||||
|
{
|
||||||
// `pub(self)` or `pub(super)`
|
// `pub(self)` or `pub(super)`
|
||||||
self.bump(); // `(`
|
self.bump(); // `(`
|
||||||
let path = self.parse_path(PathStyle::Mod)?.default_to_global(); // `super`/`self`
|
let path = self.parse_path(PathStyle::Mod)?.default_to_global(); // `super`/`self`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue