store the span of the nested part of the use tree in the ast
This commit is contained in:
parent
2ec337c193
commit
13f76235b3
17 changed files with 45 additions and 36 deletions
|
@ -336,7 +336,7 @@ impl<'a> Parser<'a> {
|
|||
UseTreeKind::Glob => {
|
||||
e.note("the wildcard token must be last on the path");
|
||||
}
|
||||
UseTreeKind::Nested(..) => {
|
||||
UseTreeKind::Nested { .. } => {
|
||||
e.note("glob-like brace syntax must be last on the path");
|
||||
}
|
||||
_ => (),
|
||||
|
@ -1056,7 +1056,11 @@ impl<'a> Parser<'a> {
|
|||
Ok(if self.eat(&token::BinOp(token::Star)) {
|
||||
UseTreeKind::Glob
|
||||
} else {
|
||||
UseTreeKind::Nested(self.parse_use_tree_list()?)
|
||||
let lo = self.token.span;
|
||||
UseTreeKind::Nested {
|
||||
items: self.parse_use_tree_list()?,
|
||||
span: lo.to(self.prev_token.span),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue