Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/items/use-declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ The [paths] that are allowed in a `use` item follow the [SimplePath] grammar and
* Nameable [items]
* [Enum variants]
* [Built-in types]
* [Associated items] of traits
* [Attributes]
* [Derive macros]
* [`macro_rules`]

r[items.use.path.disallowed]
They cannot import [associated items], [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.
They cannot import associated items of structs or enums, [generic parameters], [local variables], paths with [`Self`], or [tool attributes]. More restrictions are described below.

r[items.use.path.namespace]
`use` will create bindings for all [namespaces] from the imported entities, with the exception that a `self` import will only import from the type namespace (as described below). For example, the following illustrates creating bindings for the same name in two namespaces:
Expand Down Expand Up @@ -467,6 +468,7 @@ r[items.use.restrictions.variant]
> ```

[`$crate`]: paths.qualifiers.macro-crate
[Associated items]: associated-items.md
[Attributes]: ../attributes.md
[brace syntax]: items.use.multiple-syntax
[Built-in types]: ../types.md
Expand All @@ -476,7 +478,6 @@ r[items.use.restrictions.variant]
[`extern crate`]: extern-crates.md
[`macro_rules`]: ../macros-by-example.md
[`self`]: ../paths.md#self
[associated items]: associated-items.md
[extern prelude]: ../names/preludes.md#extern-prelude
[generic parameters]: generics.md
[items]: ../items.md
Expand Down
Loading