Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference.md: change "mod" to "self" in "use" declaration. #21179

Merged
merged 1 commit into from
Jan 21, 2015
Merged
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
8 changes: 4 additions & 4 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
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