about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-08 21:47:34 +0000
committerbors <bors@rust-lang.org>2024-05-08 21:47:34 +0000
commit87293c9585a7fb2cc83ca9949ae79661d5d3c31a (patch)
tree0da5b74cc9fa04e455e51d8db14ce993647a1f91 /compiler/rustc_parse/src/parser
parentec1b69852f0c24ae833a74303800db2229b6653e (diff)
parent782ef181683cb5568e23f1071cfff9c5daa8564c (diff)
downloadrust-87293c9585a7fb2cc83ca9949ae79661d5d3c31a.tar.gz
rust-87293c9585a7fb2cc83ca9949ae79661d5d3c31a.zip
Auto merge of #124910 - matthiaskrgr:rollup-lo1uvdn, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #123344 (Remove braces when fixing a nested use tree into a single item)
 - #124587 (Generic `NonZero` post-stabilization changes.)
 - #124775 (crashes: add lastest batch of crash tests)
 - #124869 (Make sure we don't deny macro vars w keyword names)
 - #124876 (Simplify `use crate::rustc_foo::bar` occurrences.)
 - #124892 (Update cc crate to v1.0.97)
 - #124903 (Ignore empty RUSTC_WRAPPER in bootstrap)
 - #124909 (Reapply the part of #124548 that bors forgot)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs8
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 848277c4611..3ac50a6e4a8 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),
+            }
         })
     }