Remove impl_id from trait_ref. Unused

This commit is contained in:
Brian Anderson 2012-12-06 19:12:25 -08:00
parent 2fcf562d16
commit ecdc8aae41
7 changed files with 4 additions and 16 deletions

View File

@ -647,9 +647,6 @@ fn convert_struct(ccx: @crate_ctxt,
let cms = convert_methods(ccx, struct_def.methods, rp, bounds);
for struct_def.traits.each |trait_ref| {
check_methods_against_trait(ccx, tps, rp, selfty, *trait_ref, cms);
// trait_ref.impl_id represents (class, trait) pair
write_ty_to_tcx(tcx, trait_ref.impl_id, tpt.ty);
tcx.tcache.insert(local_def(trait_ref.impl_id), tpt);
}
// If this struct is enum-like or tuple-like, create the type of its

View File

@ -1417,7 +1417,7 @@ type attribute_ = {style: attr_style, value: meta_item, is_sugared_doc: bool};
*/
#[auto_serialize]
#[auto_deserialize]
type trait_ref = {path: @path, ref_id: node_id, impl_id: node_id};
type trait_ref = {path: @path, ref_id: node_id};
#[auto_serialize]
#[auto_deserialize]

View File

@ -254,9 +254,6 @@ fn map_item(i: @item, cx: ctx, v: vt) {
// so we can find the self_ty
for traits.each |p| {
cx.map.insert(p.ref_id, node_item(i, item_path));
// This is so we can look up the right things when
// encoding/decoding
cx.map.insert(p.impl_id, node_item(i, item_path));
}
for (*methods).each |tm| {
let id = ast_util::trait_method_to_ty_method(*tm).id;
@ -282,9 +279,6 @@ fn map_struct_def(struct_def: @ast::struct_def, parent_node: ast_node,
// so we can find the self_ty
for struct_def.traits.each |p| {
cx.map.insert(p.ref_id, parent_node);
// This is so we can look up the right things when
// encoding/decoding
cx.map.insert(p.impl_id, parent_node);
}
let d_id = ast_util::local_def(id);
let p = extend(cx, ident);

View File

@ -393,7 +393,6 @@ fn mk_impl(
let opt_trait = Some(@{
path: path,
ref_id: cx.next_id(),
impl_id: cx.next_id(),
});
let ty = cx.ty_path(

View File

@ -220,8 +220,7 @@ fn create_derived_impl(cx: ext_ctxt,
let trait_path = @move trait_path;
let trait_ref = {
path: trait_path,
ref_id: cx.next_id(),
impl_id: cx.next_id(),
ref_id: cx.next_id()
};
let trait_ref = @move trait_ref;

View File

@ -280,8 +280,7 @@ fn fold_struct_def(struct_def: @ast::struct_def, fld: ast_fold)
}
fn fold_trait_ref(&&p: @trait_ref, fld: ast_fold) -> @trait_ref {
@{path: fld.fold_path(p.path), ref_id: fld.new_id(p.ref_id),
impl_id: fld.new_id(p.impl_id)}
@{path: fld.fold_path(p.path), ref_id: fld.new_id(p.ref_id)}
}
fn fold_struct_field(&&f: @struct_field, fld: ast_fold) -> @struct_field {

View File

@ -2821,7 +2821,7 @@ impl Parser {
fn parse_trait_ref() -> @trait_ref {
@{path: self.parse_path_with_tps(false),
ref_id: self.get_id(), impl_id: self.get_id()}
ref_id: self.get_id()}
}
fn parse_trait_ref_list(ket: token::Token) -> ~[@trait_ref] {