Skip to content

Commit 931514c

Browse files
committed
Remove commented-out code and old comments that accidentally snuck in
1 parent 3d4ef74 commit 931514c

File tree

3 files changed

+4
-44
lines changed

3 files changed

+4
-44
lines changed

src/rustc/metadata/common.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ const tag_item_field: uint = 0x44u;
8585
const tag_class_mut: uint = 0x45u;
8686

8787
const tag_region_param: uint = 0x46u;
88-
const tag_mod_impl_use: uint = 0x47u;
89-
const tag_mod_impl_iface: uint = 0x48u;
88+
const tag_mod_impl_iface: uint = 0x47u;
9089
/*
9190
iface items contain tag_item_iface_method elements,
9291
impl items contain tag_item_impl_method elements, and classes
@@ -95,7 +94,7 @@ const tag_mod_impl_iface: uint = 0x48u;
9594
both, tag_item_iface_method and tag_item_impl_method have to be two
9695
different tags.
9796
*/
98-
const tag_item_impl_method: uint = 0x49u;
97+
const tag_item_impl_method: uint = 0x48u;
9998

10099
// used to encode crate_ctxt side tables
101100
enum astencode_tag { // Reserves 0x50 -- 0x6f

src/rustc/metadata/decoder.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -417,24 +417,8 @@ fn get_impls_for_mod(cdata: cmd, m_id: ast::node_id,
417417
let mod_item = lookup_item(m_id, data);
418418
let mut result = [];
419419
ebml::tagged_docs(mod_item, tag_mod_impl) {|doc|
420-
/*
421-
Pair of an item did and an iface did.
422-
The second one is unneeded if the first id names
423-
an impl; disambiguates if it's a class
424-
*/
425-
let did = parse_def_id(ebml::doc_data(ebml::get_doc(doc,
426-
tag_mod_impl_use)));
420+
let did = parse_def_id(ebml::doc_data(doc));
427421
let local_did = translate_def_id(cdata, did);
428-
/*
429-
// iface is optional
430-
let iface_did = option::map(ebml::maybe_get_doc(doc,
431-
tag_mod_impl_iface)) {|d|
432-
parse_def_id(ebml::doc_data(d))};
433-
option::iter(iface_did) {|x|
434-
let _local_iface_did = translate_def_id(cdata, x);
435-
};
436-
*/
437-
// CONFUSED -- previous code is pointless
438422
// The impl may be defined in a different crate. Ask the caller
439423
// to give us the metadata
440424
let impl_cdata = get_cdata(local_did.crate);
@@ -444,8 +428,6 @@ fn get_impls_for_mod(cdata: cmd, m_id: ast::node_id,
444428
if alt name { some(n) { n == nm } none { true } } {
445429
let base_tps = item_ty_param_count(item);
446430
result += [@{
447-
// here, we need to... reconstruct the iface_ref?
448-
// probz broken
449431
did: local_did, ident: nm,
450432
methods: item_impl_methods(impl_cdata, item, base_tps)
451433
}];

src/rustc/metadata/encoder.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: ebml::writer, md: _mod,
372372
ebml_w.start_tag(tag_mod_impl);
373373
/* If did stands for an iface
374374
ref, we need to map it to its parent class */
375-
ebml_w.start_tag(tag_mod_impl_use);
376-
let iface_ty = alt ecx.ccx.tcx.items.get(i.did.node) {
375+
alt ecx.ccx.tcx.items.get(i.did.node) {
377376
ast_map::node_item(it@@{node: cl@item_class(*),_},_) {
378377
ebml_w.wr_str(def_to_str(local_def(it.id)));
379378
some(ty::lookup_item_type(ecx.ccx.tcx, i.did).ty)
@@ -388,26 +387,6 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: ebml::writer, md: _mod,
388387
}
389388
};
390389
ebml_w.end_tag();
391-
392-
/*
393-
/* Write the iface did if it exists */
394-
option::iter(iface_ty) {|i|
395-
alt ty::get(i).struct {
396-
ty::ty_iface(did, tys) {
397-
// FIXME: tys?
398-
ebml_w.start_tag(tag_mod_impl_iface);
399-
ebml_w.wr_str(def_to_str(did));
400-
ebml_w.end_tag();
401-
402-
}
403-
t {
404-
ecx.ccx.tcx.sess.bug(#fmt("Expected item to implement \
405-
an iface, but found %s",
406-
util::ppaux::ty_to_str(ecx.ccx.tcx, i)));
407-
}
408-
}}
409-
*/
410-
ebml_w.end_tag();
411390
} // if
412391
} // for
413392
} // list::cons alt

0 commit comments

Comments
 (0)