Skip to content

Commit

Permalink
reference.md: change "mod" to "self" in "use" declaration.
Browse files Browse the repository at this point in the history
This should have been done together with 56dcbd1
for #20361

Signed-off-by: NODA, Kai <nodakai@gmail.com>
  • Loading branch information
nodakai committed Jan 15, 2015
1 parent 451e134 commit 195fd9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/doc/reference.md
Expand Up @@ -971,7 +971,7 @@ path_glob : ident [ "::" [ path_glob
| '*' ] ] ?
| '{' path_item [ ',' path_item ] * '}' ;
path_item : ident | "mod" ;
path_item : ident | "self" ;
```

A _use declaration_ creates one or more local name bindings synonymous with
Expand All @@ -991,15 +991,15 @@ Use declarations support a number of convenient shortcuts:
* 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 `mod` keyword, such as
`use a::b::{mod, c, d};`
and their immediate parent module, using the `self` keyword, such as
`use a::b::{self, c, d};`

An example of `use` declarations:

```
use std::iter::range_step;
use std::option::Option::{Some, None};
use std::collections::hash_map::{mod, HashMap};
use std::collections::hash_map::{self, HashMap};
fn foo<T>(_: T){}
fn bar(map1: HashMap<String, uint>, map2: hash_map::HashMap<String, uint>){}
Expand Down

1 comment on commit 195fd9a

@huonw
Copy link
Member

@huonw huonw commented on 195fd9a Jan 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ rollup

Please sign in to comment.