diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2024-04-02 00:26:10 +0200 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2024-04-14 18:45:28 +0200 |
| commit | 13f76235b333f4b9c750be45839b488d7f5c8203 (patch) | |
| tree | 42289a05fb4042517ef2207473b478cdb5f67d9a /compiler/rustc_parse/src/parser | |
| parent | 2ec337c19336845b371dcd6bc1369e6b34124afd (diff) | |
| download | rust-13f76235b333f4b9c750be45839b488d7f5c8203.tar.gz rust-13f76235b333f4b9c750be45839b488d7f5c8203.zip | |
store the span of the nested part of the use tree in the ast
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index d54eb8dc4c9..7332cc86220 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -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), + } }) } |
