From 288799786b0e6e9ce3d2260b47574e51e1ab7b15 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 16 May 2012 22:46:57 -0700 Subject: [PATCH] rustc: Sever the link between metadata and resolve --- src/rustc/metadata.rs | 2 -- src/rustc/metadata/csearch.rs | 2 +- src/rustc/metadata/decoder.rs | 9 +++++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/rustc/metadata.rs b/src/rustc/metadata.rs index 740a6678eed..28a9757d22a 100644 --- a/src/rustc/metadata.rs +++ b/src/rustc/metadata.rs @@ -7,8 +7,6 @@ mod middle { export ast_map; import ty = middle_::ty; export ty; - import resolve = middle_::resolve; - export resolve; } mod front { diff --git a/src/rustc/metadata/csearch.rs b/src/rustc/metadata/csearch.rs index 5ebdc144ae7..db758048bde 100644 --- a/src/rustc/metadata/csearch.rs +++ b/src/rustc/metadata/csearch.rs @@ -116,7 +116,7 @@ fn get_enum_variants(tcx: ty::ctxt, def: ast::def_id) -> [ty::variant_info] { fn get_impls_for_mod(cstore: cstore::cstore, def: ast::def_id, name: option) - -> @[@middle::resolve::_impl] { + -> @[@decoder::_impl] { let cdata = cstore::get_crate_data(cstore, def.crate); decoder::get_impls_for_mod(cdata, def.node, name) {|cnum| cstore::get_crate_data(cstore, cnum) diff --git a/src/rustc/metadata/decoder.rs b/src/rustc/metadata/decoder.rs index 832dda817e3..41b743d8384 100644 --- a/src/rustc/metadata/decoder.rs +++ b/src/rustc/metadata/decoder.rs @@ -42,6 +42,7 @@ export maybe_find_item; // sketchy export item_type; // sketchy export maybe_get_item_ast; export decode_inlined_item; +export method_info, _impl; // Used internally by astencode: export translate_def_id; @@ -416,8 +417,12 @@ fn get_enum_variants(cdata: cmd, id: ast::node_id, tcx: ty::ctxt) ret infos; } +// NB: These types are duplicated in resolve.rs +type method_info = {did: ast::def_id, n_tps: uint, ident: ast::ident}; +type _impl = {did: ast::def_id, ident: ast::ident, methods: [@method_info]}; + fn item_impl_methods(cdata: cmd, item: ebml::doc, base_tps: uint) - -> [@middle::resolve::method_info] { + -> [@method_info] { let mut rslt = []; ebml::tagged_docs(item, tag_item_impl_method) {|doc| let m_did = parse_def_id(ebml::doc_data(doc)); @@ -434,7 +439,7 @@ fn item_impl_methods(cdata: cmd, item: ebml::doc, base_tps: uint) fn get_impls_for_mod(cdata: cmd, m_id: ast::node_id, name: option, get_cdata: fn(ast::crate_num) -> cmd) - -> @[@middle::resolve::_impl] { + -> @[@_impl] { let data = cdata.data; let mod_item = lookup_item(m_id, data); let mut result = [];