Skip to content

Commit e213160

Browse files
committed
---
yaml --- r: 47074 b: refs/heads/try c: 91fae27 h: refs/heads/master v: v3
1 parent a510f68 commit e213160

File tree

16 files changed

+186
-187
lines changed

16 files changed

+186
-187
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: 5b5ac331db98bdcf74124e7b55309501e080146d
5+
refs/heads/try: 91fae2791292c7374143e82814a375a12bfd4e83
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/front/core_inject.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ fn inject_libcore_ref(sess: Session,
4545
fold_crate: |crate, span, fld| {
4646
let n1 = sess.next_node_id();
4747
let vi1 = @ast::view_item {
48-
node: ast::view_item_extern_mod(
49-
sess.ident_of(~"core"), ~[], n1),
48+
node: ast::view_item_use(sess.ident_of(~"core"), ~[], n1),
5049
attrs: ~[
5150
spanned(ast::attribute_ {
5251
style: ast::attr_inner,
@@ -87,7 +86,7 @@ fn inject_libcore_ref(sess: Session,
8786
};
8887

8988
let vp = @spanned(ast::view_path_glob(prelude_path, n2));
90-
let vi2 = @ast::view_item { node: ast::view_item_use(~[vp]),
89+
let vi2 = @ast::view_item { node: ast::view_item_import(~[vp]),
9190
attrs: ~[],
9291
vis: ast::private,
9392
span: dummy_sp() };

branches/try/src/librustc/front/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ fn mk_std(cx: &TestCtxt) -> @ast::view_item {
266266
let mi = nospan(mi);
267267
let id_std = cx.sess.ident_of(~"std");
268268
let vi = if is_std(cx) {
269-
ast::view_item_use(
269+
ast::view_item_import(
270270
~[@nospan(ast::view_path_simple(id_std,
271271
path_node(~[id_std]),
272272
ast::type_value_ns,
273273
cx.sess.next_node_id()))])
274274
} else {
275-
ast::view_item_extern_mod(id_std, ~[@mi],
275+
ast::view_item_use(id_std, ~[@mi],
276276
cx.sess.next_node_id())
277277
};
278278
let vi = ast::view_item {

branches/try/src/librustc/metadata/creader.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,10 @@ struct Env {
127127

128128
fn visit_view_item(e: @mut Env, i: @ast::view_item) {
129129
match /*bad*/copy i.node {
130-
ast::view_item_extern_mod(ident, meta_items, id) => {
131-
debug!("resolving extern mod stmt. ident: %?, meta: %?",
132-
ident, meta_items);
130+
ast::view_item_use(ident, meta_items, id) => {
131+
debug!("resolving use stmt. ident: %?, meta: %?", ident, meta_items);
133132
let cnum = resolve_crate(e, ident, meta_items, ~"", i.span);
134-
cstore::add_extern_mod_stmt_cnum(e.cstore, id, cnum);
133+
cstore::add_use_stmt_cnum(e.cstore, id, cnum);
135134
}
136135
_ => ()
137136
}

branches/try/src/librustc/metadata/cstore.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ pub type crate_metadata = @{name: ~str,
4040

4141
pub struct CStore {
4242
priv metas: oldmap::HashMap<ast::crate_num, crate_metadata>,
43-
priv extern_mod_crate_map: extern_mod_crate_map,
43+
priv use_crate_map: use_crate_map,
4444
priv used_crate_files: ~[Path],
4545
priv used_libraries: ~[~str],
4646
priv used_link_args: ~[~str],
4747
intr: @ident_interner
4848
}
4949

50-
// Map from node_id's of local extern mod statements to crate numbers
51-
type extern_mod_crate_map = oldmap::HashMap<ast::node_id, ast::crate_num>;
50+
// Map from node_id's of local use statements to crate numbers
51+
type use_crate_map = oldmap::HashMap<ast::node_id, ast::crate_num>;
5252

5353
pub fn mk_cstore(intr: @ident_interner) -> CStore {
5454
let meta_cache = oldmap::HashMap();
5555
let crate_map = oldmap::HashMap();
5656
return CStore {
5757
metas: meta_cache,
58-
extern_mod_crate_map: crate_map,
58+
use_crate_map: crate_map,
5959
used_crate_files: ~[],
6060
used_libraries: ~[],
6161
used_link_args: ~[],
@@ -127,18 +127,18 @@ pub fn get_used_link_args(cstore: @mut CStore) -> ~[~str] {
127127
return /*bad*/copy cstore.used_link_args;
128128
}
129129

130-
pub fn add_extern_mod_stmt_cnum(cstore: @mut CStore,
131-
emod_id: ast::node_id,
132-
cnum: ast::crate_num) {
133-
let extern_mod_crate_map = cstore.extern_mod_crate_map;
134-
extern_mod_crate_map.insert(emod_id, cnum);
130+
pub fn add_use_stmt_cnum(cstore: @mut CStore,
131+
use_id: ast::node_id,
132+
cnum: ast::crate_num) {
133+
let use_crate_map = cstore.use_crate_map;
134+
use_crate_map.insert(use_id, cnum);
135135
}
136136

137-
pub fn find_extern_mod_stmt_cnum(cstore: @mut CStore,
138-
emod_id: ast::node_id)
137+
pub fn find_use_stmt_cnum(cstore: @mut CStore,
138+
use_id: ast::node_id)
139139
-> Option<ast::crate_num> {
140-
let extern_mod_crate_map = cstore.extern_mod_crate_map;
141-
extern_mod_crate_map.find(&emod_id)
140+
let use_crate_map = cstore.use_crate_map;
141+
use_crate_map.find(&use_id)
142142
}
143143

144144
// returns hashes of crates directly used by this crate. Hashes are
@@ -147,8 +147,8 @@ pub fn get_dep_hashes(cstore: @mut CStore) -> ~[~str] {
147147
type crate_hash = {name: ~str, hash: ~str};
148148
let mut result = ~[];
149149

150-
let extern_mod_crate_map = cstore.extern_mod_crate_map;
151-
for extern_mod_crate_map.each_value |&cnum| {
150+
let use_crate_map = cstore.use_crate_map;
151+
for use_crate_map.each_value |&cnum| {
152152
let cdata = cstore::get_crate_data(cstore, cnum);
153153
let hash = decoder::get_crate_hash(cdata.data);
154154
debug!("Add hash[%s]: %s", cdata.name, hash);

branches/try/src/librustc/middle/resolve.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use driver::session::Session;
1515
use metadata::csearch::{each_path, get_method_names_if_trait};
1616
use metadata::csearch::{get_static_methods_if_impl, get_struct_fields};
1717
use metadata::csearch::{get_type_name_if_impl};
18-
use metadata::cstore::find_extern_mod_stmt_cnum;
18+
use metadata::cstore::find_use_stmt_cnum;
1919
use metadata::decoder::{def_like, dl_def, dl_field, dl_impl};
2020
use middle::lang_items::LanguageItems;
2121
use middle::lint::{deny, allow, forbid, level, unused_imports, warn};
@@ -55,7 +55,7 @@ use syntax::ast::{ty_bool, ty_char, ty_f, ty_f32, ty_f64, ty_float, ty_i};
5555
use syntax::ast::{ty_i16, ty_i32, ty_i64, ty_i8, ty_int, ty_param, ty_path};
5656
use syntax::ast::{ty_str, ty_u, ty_u16, ty_u32, ty_u64, ty_u8, ty_uint};
5757
use syntax::ast::{type_value_ns, ty_param_bound, unnamed_field};
58-
use syntax::ast::{variant, view_item, view_item_extern_mod};
58+
use syntax::ast::{variant, view_item, view_item_import};
5959
use syntax::ast::{view_item_use, view_path_glob, view_path_list};
6060
use syntax::ast::{view_path_simple, visibility, anonymous, named, not};
6161
use syntax::ast::{unsafe_fn};
@@ -1388,7 +1388,7 @@ pub impl Resolver {
13881388
&&_visitor: vt<ReducedGraphParent>) {
13891389
let privacy = visibility_to_privacy(view_item.vis);
13901390
match /*bad*/copy view_item.node {
1391-
view_item_use(view_paths) => {
1391+
view_item_import(view_paths) => {
13921392
for view_paths.each |view_path| {
13931393
// Extract and intern the module part of the path. For
13941394
// globs and lists, the path is found directly in the AST;
@@ -1462,9 +1462,8 @@ pub impl Resolver {
14621462
}
14631463
}
14641464
1465-
view_item_extern_mod(name, _, node_id) => {
1466-
match find_extern_mod_stmt_cnum(self.session.cstore,
1467-
node_id) {
1465+
view_item_use(name, _, node_id) => {
1466+
match find_use_stmt_cnum(self.session.cstore, node_id) {
14681467
Some(crate_id) => {
14691468
let (child_name_bindings, new_parent) =
14701469
self.add_child(name, parent, ForbidDuplicateTypes,

0 commit comments

Comments
 (0)