Fix regression in resolving of external impls
This commit is contained in:
parent
87253cf3a9
commit
f2352f4062
@ -273,13 +273,13 @@ fn get_tag_variants(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
|
||||
ret infos;
|
||||
}
|
||||
|
||||
fn item_impl_methods(data: @[u8], item: ebml::doc, base_tps: uint)
|
||||
fn item_impl_methods(cdata: cmd, item: ebml::doc, base_tps: uint)
|
||||
-> [@middle::resolve::method_info] {
|
||||
let rslt = [];
|
||||
ebml::tagged_docs(item, tag_item_method) {|doc|
|
||||
let m_did = parse_def_id(ebml::doc_data(doc));
|
||||
let mth_item = lookup_item(m_did.node, data);
|
||||
rslt += [@{did: m_did,
|
||||
let mth_item = lookup_item(m_did.node, cdata.data);
|
||||
rslt += [@{did: translate_def_id(cdata, m_did),
|
||||
n_tps: item_ty_param_count(mth_item) - base_tps,
|
||||
ident: item_name(mth_item)}];
|
||||
}
|
||||
@ -298,7 +298,7 @@ fn get_impls_for_mod(cdata: cmd, m_id: ast::node_id,
|
||||
let base_tps = item_ty_param_count(doc);
|
||||
let i_did = item_impl_iface_did(item, cdata);
|
||||
result += [@{did: did, iface_did: i_did, ident: nm,
|
||||
methods: item_impl_methods(data, doc, base_tps)}];
|
||||
methods: item_impl_methods(cdata, item, base_tps)}];
|
||||
}
|
||||
}
|
||||
@result
|
||||
|
@ -1922,19 +1922,22 @@ fn find_impls_in_mod(e: env, m: def, &impls: [@_impl],
|
||||
cached = if defid.crate == ast::local_crate {
|
||||
let tmp = [];
|
||||
for i in option::get(e.mod_map.get(defid.node).m).items {
|
||||
find_impls_in_item(e, i, tmp, name, none);
|
||||
find_impls_in_item(e, i, tmp, none, none);
|
||||
}
|
||||
@tmp
|
||||
} else {
|
||||
csearch::get_impls_for_mod(e.sess.get_cstore(), defid, name)
|
||||
csearch::get_impls_for_mod(e.sess.get_cstore(), defid, none)
|
||||
};
|
||||
e.impl_cache.insert(defid, cached);
|
||||
}
|
||||
}
|
||||
for im in *cached {
|
||||
if alt name { some(n) { n == im.ident } _ { true } } {
|
||||
impls += [im];
|
||||
alt name {
|
||||
some(n) {
|
||||
for im in *cached {
|
||||
if n == im.ident { impls += [im]; }
|
||||
}
|
||||
}
|
||||
_ { impls += *cached; }
|
||||
}
|
||||
}
|
||||
_ {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user