Skip to content

Commit

Permalink
Merge pull request #55 from matthewjasper/document-1219
Browse files Browse the repository at this point in the history
Document RFC 1219: `use` group `as`
  • Loading branch information
steveklabnik authored May 17, 2017
2 parents 8a02263 + 610b3b1 commit e793ca8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,16 @@ path required to refer to a module item. These declarations may appear in
Use declarations support a number of convenient shortcuts:

* Rebinding the target name as a new local name, using the syntax `use p::q::r as x;`
* Simultaneously binding a list of paths differing only in their final element,
using the glob-like brace syntax `use a::b::{c,d,e,f};`
* Binding all paths matching a given prefix, using the asterisk wildcard syntax
`use a::b::*;`
* Simultaneously binding a list of paths differing only in their final element
and their immediate parent module, using the `self` keyword, such as
`use a::b::{self, c, d};`
* Rebinding the target name as a new local name, using the syntax `use p::q::r
as x;`. This can also be used with the last two features: `use a::b::{self as
ab, c as abc}`.
* Binding all paths matching a given prefix, using the asterisk wildcard syntax
`use a::b::*;`

An example of `use` declarations:

Expand Down

0 comments on commit e793ca8

Please sign in to comment.