@@ -924,7 +924,9 @@ use_decl : "pub" ? "use" [ path "as" ident
924924
925925path_glob : ident [ "::" [ path_glob
926926 | '*' ] ] ?
927- | '{' ident [ ',' ident ] * '}' ;
927+ | '{' path_item [ ',' path_item ] * '}' ;
928+
929+ path_item : ident | "mod" ;
928930~~~~
929931
930932A _ use declaration_ creates one or more local name bindings synonymous
@@ -943,14 +945,18 @@ Use declarations support a number of convenient shortcuts:
943945 * Simultaneously binding a list of paths differing only in their final element,
944946 using the glob-like brace syntax ` use a::b::{c,d,e,f}; `
945947 * Binding all paths matching a given prefix, using the asterisk wildcard syntax ` use a::b::*; `
948+ * Simultaneously binding a list of paths differing only in their final element
949+ and their immediate parent module, using the ` mod ` keyword, such as ` use a::b::{mod, c, d}; `
946950
947951An example of ` use ` declarations:
948952
949953~~~~
950954use std::iter::range_step;
951955use std::option::{Some, None};
956+ use std::collections::hashmap::{mod, HashMap};
952957
953958# fn foo<T>(_: T){}
959+ # fn bar(map: HashMap<String, uint>, set: hashmap::HashSet<String>){}
954960
955961fn main() {
956962 // Equivalent to 'std::iter::range_step(0u, 10u, 2u);'
@@ -959,6 +965,11 @@ fn main() {
959965 // Equivalent to 'foo(vec![std::option::Some(1.0f64),
960966 // std::option::None]);'
961967 foo(vec![Some(1.0f64), None]);
968+
969+ // Both `hash` and `HashMap` are in scope.
970+ let map = HashMap::new();
971+ let set = hashmap::HashSet::new();
972+ bar(map, set);
962973}
963974~~~~
964975
0 commit comments