Skip to content

Commit ecdc8aa

Browse files
committed
Remove impl_id from trait_ref. Unused
1 parent 2fcf562 commit ecdc8aa

File tree

7 files changed

+4
-16
lines changed

7 files changed

+4
-16
lines changed

src/librustc/middle/typeck/collect.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,6 @@ fn convert_struct(ccx: @crate_ctxt,
647647
let cms = convert_methods(ccx, struct_def.methods, rp, bounds);
648648
for struct_def.traits.each |trait_ref| {
649649
check_methods_against_trait(ccx, tps, rp, selfty, *trait_ref, cms);
650-
// trait_ref.impl_id represents (class, trait) pair
651-
write_ty_to_tcx(tcx, trait_ref.impl_id, tpt.ty);
652-
tcx.tcache.insert(local_def(trait_ref.impl_id), tpt);
653650
}
654651

655652
// If this struct is enum-like or tuple-like, create the type of its

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ type attribute_ = {style: attr_style, value: meta_item, is_sugared_doc: bool};
14171417
*/
14181418
#[auto_serialize]
14191419
#[auto_deserialize]
1420-
type trait_ref = {path: @path, ref_id: node_id, impl_id: node_id};
1420+
type trait_ref = {path: @path, ref_id: node_id};
14211421

14221422
#[auto_serialize]
14231423
#[auto_deserialize]

src/libsyntax/ast_map.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,6 @@ fn map_item(i: @item, cx: ctx, v: vt) {
254254
// so we can find the self_ty
255255
for traits.each |p| {
256256
cx.map.insert(p.ref_id, node_item(i, item_path));
257-
// This is so we can look up the right things when
258-
// encoding/decoding
259-
cx.map.insert(p.impl_id, node_item(i, item_path));
260257
}
261258
for (*methods).each |tm| {
262259
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,
282279
// so we can find the self_ty
283280
for struct_def.traits.each |p| {
284281
cx.map.insert(p.ref_id, parent_node);
285-
// This is so we can look up the right things when
286-
// encoding/decoding
287-
cx.map.insert(p.impl_id, parent_node);
288282
}
289283
let d_id = ast_util::local_def(id);
290284
let p = extend(cx, ident);

src/libsyntax/ext/auto_serialize.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ fn mk_impl(
393393
let opt_trait = Some(@{
394394
path: path,
395395
ref_id: cx.next_id(),
396-
impl_id: cx.next_id(),
397396
});
398397

399398
let ty = cx.ty_path(

src/libsyntax/ext/deriving.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ fn create_derived_impl(cx: ext_ctxt,
220220
let trait_path = @move trait_path;
221221
let trait_ref = {
222222
path: trait_path,
223-
ref_id: cx.next_id(),
224-
impl_id: cx.next_id(),
223+
ref_id: cx.next_id()
225224
};
226225
let trait_ref = @move trait_ref;
227226

src/libsyntax/fold.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ fn fold_struct_def(struct_def: @ast::struct_def, fld: ast_fold)
280280
}
281281

282282
fn fold_trait_ref(&&p: @trait_ref, fld: ast_fold) -> @trait_ref {
283-
@{path: fld.fold_path(p.path), ref_id: fld.new_id(p.ref_id),
284-
impl_id: fld.new_id(p.impl_id)}
283+
@{path: fld.fold_path(p.path), ref_id: fld.new_id(p.ref_id)}
285284
}
286285

287286
fn fold_struct_field(&&f: @struct_field, fld: ast_fold) -> @struct_field {

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2821,7 +2821,7 @@ impl Parser {
28212821

28222822
fn parse_trait_ref() -> @trait_ref {
28232823
@{path: self.parse_path_with_tps(false),
2824-
ref_id: self.get_id(), impl_id: self.get_id()}
2824+
ref_id: self.get_id()}
28252825
}
28262826

28272827
fn parse_trait_ref_list(ket: token::Token) -> ~[@trait_ref] {

0 commit comments

Comments
 (0)