File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -3070,7 +3070,29 @@ impl<'a> LoweringContext<'a> {
3070
3070
hir:: ItemKind :: Use ( path, hir:: UseKind :: Glob )
3071
3071
}
3072
3072
UseTreeKind :: Nested ( ref trees) => {
3073
- // Nested imports are desugared into simple imports.
3073
+ // Nested imports are desugared into simple
3074
+ // imports. So if we start with
3075
+ //
3076
+ // ```
3077
+ // pub(x) use foo::{a, b};
3078
+ // ```
3079
+ //
3080
+ // we will create three items:
3081
+ //
3082
+ // ```
3083
+ // pub(x) use foo::a;
3084
+ // pub(x) use foo::b;
3085
+ // pub(x) use foo::{}; // <-- this is called the `ListStem`
3086
+ // ```
3087
+ //
3088
+ // The first two are produced by recursively invoking
3089
+ // `lower_use_tree` (and indeed there may be things
3090
+ // like `use foo::{a::{b, c}}` and so forth). They
3091
+ // wind up being directly added to
3092
+ // `self.items`. However, the structure of this
3093
+ // function also requires us to return one item, and
3094
+ // for that we return the `{}` import (called the
3095
+ // "`ListStem`").
3074
3096
3075
3097
let prefix = Path {
3076
3098
segments,
You can’t perform that action at this time.
0 commit comments