You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An empty brace does not import anything. `a::b::{}` is treated as `a::b::{self as _}` and `use {};` has no effect.
166
+
An empty brace does not import anything, though the leading path is validated that it is accessible.
167
+
<!-- This is slightly wrong, see https://github.com/rust-lang/rust/issues/61826 -->
167
168
168
169
> **Edition Differences**: In the 2015 edition, paths are relative to the crate root, so an import such as `use {foo, bar};` will import the names `foo` and `bar` from the crate root, whereas starting in 2018 those names are relative to the current scope.
169
170
@@ -205,8 +206,9 @@ fn main() {
205
206
}
206
207
```
207
208
208
-
> **Note**: `self` as the first segment of a `use` path has a different meaning from `self` inside braces.
209
-
> See [`self`] in the paths chapter for more information no the meaning of a leading `self`.
209
+
> **Note**: `self` may also be used as the first segment of a path.
210
+
> The usage of `self` as the first segment and inside a `use` brace is logically the same; it means the current module of the parent segment, or the current module if there is no parent segment.
211
+
> See [`self`] in the paths chapter for more information on the meaning of a leading `self`.
210
212
211
213
## Glob imports
212
214
@@ -232,7 +234,7 @@ mod foo {
232
234
```
233
235
234
236
Items and named imports are allowed to shadow names from glob imports in the same [namespace].
235
-
That is, if there is a name already defined by another item in the same namespace, the glob import will skip it.
237
+
That is, if there is a name already defined by another item in the same namespace, the glob import will be shadowed.
0 commit comments