rustc::metadata: use u64 for DefId's instead of strings.
This commit is contained in:
parent
7129b25949
commit
8bcb3cb475
2 changed files with 71 additions and 85 deletions
|
|
@ -21,7 +21,8 @@ use metadata::common::*;
|
|||
use metadata::csearch::MethodInfo;
|
||||
use metadata::csearch;
|
||||
use metadata::cstore;
|
||||
use metadata::tydecode::{parse_ty_data, parse_region_data, parse_def_id,
|
||||
use metadata::encoder::def_to_u64;
|
||||
use metadata::tydecode::{parse_ty_data, parse_region_data,
|
||||
parse_type_param_def_data, parse_bare_fn_ty_data,
|
||||
parse_trait_ref_data, parse_predicate_data};
|
||||
use middle::def;
|
||||
|
|
@ -190,29 +191,32 @@ fn item_symbol(item: rbml::Doc) -> String {
|
|||
reader::get_doc(item, tag_items_data_item_symbol).as_str().to_string()
|
||||
}
|
||||
|
||||
fn item_parent_item(d: rbml::Doc) -> Option<ast::DefId> {
|
||||
fn translated_def_id(cdata: Cmd, d: rbml::Doc) -> ast::DefId {
|
||||
let id = reader::doc_as_u64(d);
|
||||
let def_id = ast::DefId { krate: (id >> 32) as u32, node: id as u32 };
|
||||
translate_def_id(cdata, def_id)
|
||||
}
|
||||
|
||||
fn item_parent_item(cdata: Cmd, d: rbml::Doc) -> Option<ast::DefId> {
|
||||
let mut ret = None;
|
||||
reader::tagged_docs(d, tag_items_data_parent_item, |did| {
|
||||
ret = Some(reader::with_doc_data(did, parse_def_id));
|
||||
ret = Some(translated_def_id(cdata, did));
|
||||
false
|
||||
});
|
||||
ret
|
||||
}
|
||||
|
||||
fn item_reqd_and_translated_parent_item(cnum: ast::CrateNum,
|
||||
d: rbml::Doc) -> ast::DefId {
|
||||
let trait_did = item_parent_item(d).expect("item without parent");
|
||||
ast::DefId { krate: cnum, node: trait_did.node }
|
||||
fn item_require_parent_item(cdata: Cmd, d: rbml::Doc) -> ast::DefId {
|
||||
translated_def_id(cdata, reader::get_doc(d, tag_items_data_parent_item))
|
||||
}
|
||||
|
||||
fn item_def_id(d: rbml::Doc, cdata: Cmd) -> ast::DefId {
|
||||
let tagdoc = reader::get_doc(d, tag_def_id);
|
||||
return translate_def_id(cdata, reader::with_doc_data(tagdoc, parse_def_id));
|
||||
translated_def_id(cdata, reader::get_doc(d, tag_def_id))
|
||||
}
|
||||
|
||||
fn get_provided_source(d: rbml::Doc, cdata: Cmd) -> Option<ast::DefId> {
|
||||
reader::maybe_get_doc(d, tag_item_method_provided_source).map(|doc| {
|
||||
translate_def_id(cdata, reader::with_doc_data(doc, parse_def_id))
|
||||
translated_def_id(cdata, doc)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -261,14 +265,12 @@ fn item_trait_ref<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd)
|
|||
}
|
||||
|
||||
fn enum_variant_ids(item: rbml::Doc, cdata: Cmd) -> Vec<ast::DefId> {
|
||||
let mut ids: Vec<ast::DefId> = Vec::new();
|
||||
let v = tag_items_data_item_variant;
|
||||
reader::tagged_docs(item, v, |p| {
|
||||
let ext = reader::with_doc_data(p, parse_def_id);
|
||||
ids.push(ast::DefId { krate: cdata.cnum, node: ext.node });
|
||||
let mut ids = vec![];
|
||||
reader::tagged_docs(item, tag_items_data_item_variant, |p| {
|
||||
ids.push(translated_def_id(cdata, p));
|
||||
true
|
||||
});
|
||||
return ids;
|
||||
ids
|
||||
}
|
||||
|
||||
fn item_path(item_doc: rbml::Doc) -> Vec<ast_map::PathElem> {
|
||||
|
|
@ -303,8 +305,7 @@ fn item_name(intr: &IdentInterner, item: rbml::Doc) -> ast::Name {
|
|||
}
|
||||
}
|
||||
|
||||
fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
|
||||
-> DefLike {
|
||||
fn item_to_def_like(cdata: Cmd, item: rbml::Doc, did: ast::DefId) -> DefLike {
|
||||
let fam = item_family(item);
|
||||
match fam {
|
||||
Constant => {
|
||||
|
|
@ -314,11 +315,9 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
|
|||
// See the comment for methods below.
|
||||
let provenance = if reader::maybe_get_doc(
|
||||
item, tag_item_trait_parent_sort).is_some() {
|
||||
def::FromTrait(item_reqd_and_translated_parent_item(cnum,
|
||||
item))
|
||||
def::FromTrait(item_require_parent_item(cdata, item))
|
||||
} else {
|
||||
def::FromImpl(item_reqd_and_translated_parent_item(cnum,
|
||||
item))
|
||||
def::FromImpl(item_require_parent_item(cdata, item))
|
||||
};
|
||||
DlDef(def::DefAssociatedConst(did, provenance))
|
||||
} else {
|
||||
|
|
@ -339,17 +338,15 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
|
|||
// a trait_parent_sort.
|
||||
let provenance = if reader::maybe_get_doc(
|
||||
item, tag_item_trait_parent_sort).is_some() {
|
||||
def::FromTrait(item_reqd_and_translated_parent_item(cnum,
|
||||
item))
|
||||
def::FromTrait(item_require_parent_item(cdata, item))
|
||||
} else {
|
||||
def::FromImpl(item_reqd_and_translated_parent_item(cnum,
|
||||
item))
|
||||
def::FromImpl(item_require_parent_item(cdata, item))
|
||||
};
|
||||
DlDef(def::DefMethod(did, provenance))
|
||||
}
|
||||
Type => {
|
||||
if item_sort(item) == Some('t') {
|
||||
let trait_did = item_reqd_and_translated_parent_item(cnum, item);
|
||||
let trait_did = item_require_parent_item(cdata, item);
|
||||
DlDef(def::DefAssociatedTy(trait_did, did))
|
||||
} else {
|
||||
DlDef(def::DefTy(did, false))
|
||||
|
|
@ -358,11 +355,11 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
|
|||
Mod => DlDef(def::DefMod(did)),
|
||||
ForeignMod => DlDef(def::DefForeignMod(did)),
|
||||
StructVariant => {
|
||||
let enum_did = item_reqd_and_translated_parent_item(cnum, item);
|
||||
let enum_did = item_require_parent_item(cdata, item);
|
||||
DlDef(def::DefVariant(enum_did, did, true))
|
||||
}
|
||||
TupleVariant => {
|
||||
let enum_did = item_reqd_and_translated_parent_item(cnum, item);
|
||||
let enum_did = item_require_parent_item(cdata, item);
|
||||
DlDef(def::DefVariant(enum_did, did, false))
|
||||
}
|
||||
Trait => DlDef(def::DefTrait(did)),
|
||||
|
|
@ -560,9 +557,7 @@ fn each_child_of_item_or_crate<F, G>(intr: Rc<IdentInterner>,
|
|||
{
|
||||
// Iterate over all children.
|
||||
let _ = reader::tagged_docs(item_doc, tag_mod_child, |child_info_doc| {
|
||||
let child_def_id = reader::with_doc_data(child_info_doc,
|
||||
parse_def_id);
|
||||
let child_def_id = translate_def_id(cdata, child_def_id);
|
||||
let child_def_id = translated_def_id(cdata, child_info_doc);
|
||||
|
||||
// This item may be in yet another crate if it was the child of a
|
||||
// reexport.
|
||||
|
|
@ -584,9 +579,7 @@ fn each_child_of_item_or_crate<F, G>(intr: Rc<IdentInterner>,
|
|||
Some(child_item_doc) => {
|
||||
// Hand off the item to the callback.
|
||||
let child_name = item_name(&*intr, child_item_doc);
|
||||
let def_like = item_to_def_like(child_item_doc,
|
||||
child_def_id,
|
||||
cdata.cnum);
|
||||
let def_like = item_to_def_like(crate_data, child_item_doc, child_def_id);
|
||||
let visibility = item_visibility(child_item_doc);
|
||||
callback(def_like, child_name, visibility);
|
||||
|
||||
|
|
@ -615,9 +608,8 @@ fn each_child_of_item_or_crate<F, G>(intr: Rc<IdentInterner>,
|
|||
if let StaticMethod = item_family(impl_method_doc) {
|
||||
// Hand off the static method to the callback.
|
||||
let static_method_name = item_name(&*intr, impl_method_doc);
|
||||
let static_method_def_like = item_to_def_like(impl_method_doc,
|
||||
impl_item_def_id,
|
||||
cdata.cnum);
|
||||
let static_method_def_like = item_to_def_like(cdata, impl_method_doc,
|
||||
impl_item_def_id);
|
||||
callback(static_method_def_like,
|
||||
static_method_name,
|
||||
item_visibility(impl_method_doc));
|
||||
|
|
@ -633,9 +625,7 @@ fn each_child_of_item_or_crate<F, G>(intr: Rc<IdentInterner>,
|
|||
let _ = each_reexport(item_doc, |reexport_doc| {
|
||||
let def_id_doc = reader::get_doc(reexport_doc,
|
||||
tag_items_data_item_reexport_def_id);
|
||||
let child_def_id = reader::with_doc_data(def_id_doc,
|
||||
parse_def_id);
|
||||
let child_def_id = translate_def_id(cdata, child_def_id);
|
||||
let child_def_id = translated_def_id(cdata, def_id_doc);
|
||||
|
||||
let name_doc = reader::get_doc(reexport_doc,
|
||||
tag_items_data_item_reexport_name);
|
||||
|
|
@ -657,9 +647,7 @@ fn each_child_of_item_or_crate<F, G>(intr: Rc<IdentInterner>,
|
|||
// Get the item.
|
||||
if let Some(child_item_doc) = maybe_find_item(child_def_id.node, other_crates_items) {
|
||||
// Hand off the item to the callback.
|
||||
let def_like = item_to_def_like(child_item_doc,
|
||||
child_def_id,
|
||||
child_def_id.krate);
|
||||
let def_like = item_to_def_like(crate_data, child_item_doc, child_def_id);
|
||||
// These items have a public visibility because they're part of
|
||||
// a public re-export.
|
||||
callback(def_like, token::intern(name), ast::Public);
|
||||
|
|
@ -733,9 +721,8 @@ pub fn maybe_get_item_ast<'tcx>(cdata: Cmd, tcx: &ty::ctxt<'tcx>, id: ast::NodeI
|
|||
match decode_inlined_item(cdata, tcx, path, item_doc) {
|
||||
Ok(ii) => csearch::FoundAst::Found(ii),
|
||||
Err(path) => {
|
||||
match item_parent_item(item_doc) {
|
||||
match item_parent_item(cdata, item_doc) {
|
||||
Some(did) => {
|
||||
let did = translate_def_id(cdata, did);
|
||||
let parent_item = lookup_item(did.node, cdata.data());
|
||||
match decode_inlined_item(cdata, tcx, path, parent_item) {
|
||||
Ok(ii) => csearch::FoundAst::FoundParent(did, ii),
|
||||
|
|
@ -759,7 +746,7 @@ pub fn get_enum_variant_defs(intr: &IdentInterner,
|
|||
let item = find_item(did.node, items);
|
||||
let name = item_name(intr, item);
|
||||
let visibility = item_visibility(item);
|
||||
match item_to_def_like(item, *did, cdata.cnum) {
|
||||
match item_to_def_like(cdata, item, *did) {
|
||||
DlDef(def @ def::DefVariant(..)) => (def, name, visibility),
|
||||
_ => unreachable!()
|
||||
}
|
||||
|
|
@ -889,8 +876,7 @@ pub fn get_impl_or_trait_item<'tcx>(intr: Rc<IdentInterner>,
|
|||
|
||||
let def_id = item_def_id(method_doc, cdata);
|
||||
|
||||
let container_id = item_reqd_and_translated_parent_item(cdata.cnum,
|
||||
method_doc);
|
||||
let container_id = item_require_parent_item(cdata, method_doc);
|
||||
let container_doc = lookup_item(container_id.node, cdata.data());
|
||||
let container = match item_family(container_doc) {
|
||||
Trait => TraitContainer(container_id),
|
||||
|
|
@ -1094,7 +1080,7 @@ pub fn get_tuple_struct_definition_if_ctor(cdata: Cmd,
|
|||
let item = lookup_item(node_id, cdata.data());
|
||||
let mut ret = None;
|
||||
reader::tagged_docs(item, tag_items_data_item_is_tuple_struct_ctor, |_| {
|
||||
ret = Some(item_reqd_and_translated_parent_item(cdata.cnum, item));
|
||||
ret = Some(item_require_parent_item(cdata, item));
|
||||
false
|
||||
});
|
||||
ret
|
||||
|
|
@ -1144,7 +1130,7 @@ pub fn get_struct_fields(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId)
|
|||
let name = item_name(&*intr, an_item);
|
||||
let did = item_def_id(an_item, cdata);
|
||||
let tagdoc = reader::get_doc(an_item, tag_item_field_origin);
|
||||
let origin_id = translate_def_id(cdata, reader::with_doc_data(tagdoc, parse_def_id));
|
||||
let origin_id = translated_def_id(cdata, tagdoc);
|
||||
result.push(ty::field_ty {
|
||||
name: name,
|
||||
id: did,
|
||||
|
|
@ -1158,7 +1144,7 @@ pub fn get_struct_fields(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId)
|
|||
let did = item_def_id(an_item, cdata);
|
||||
let tagdoc = reader::get_doc(an_item, tag_item_field_origin);
|
||||
let f = item_family(an_item);
|
||||
let origin_id = translate_def_id(cdata, reader::with_doc_data(tagdoc, parse_def_id));
|
||||
let origin_id = translated_def_id(cdata, tagdoc);
|
||||
result.push(ty::field_ty {
|
||||
name: special_idents::unnamed_field.name,
|
||||
id: did,
|
||||
|
|
@ -1386,11 +1372,10 @@ pub fn each_implementation_for_trait<F>(cdata: Cmd,
|
|||
pub fn get_trait_of_item(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
|
||||
-> Option<ast::DefId> {
|
||||
let item_doc = lookup_item(id, cdata.data());
|
||||
let parent_item_id = match item_parent_item(item_doc) {
|
||||
let parent_item_id = match item_parent_item(cdata, item_doc) {
|
||||
None => return None,
|
||||
Some(item_id) => item_id,
|
||||
};
|
||||
let parent_item_id = translate_def_id(cdata, parent_item_id);
|
||||
let parent_item_doc = lookup_item(parent_item_id.node, cdata.data());
|
||||
match item_family(parent_item_doc) {
|
||||
Trait => Some(item_def_id(parent_item_doc, cdata)),
|
||||
|
|
@ -1538,8 +1523,7 @@ fn doc_generics<'tcx>(base_doc: rbml::Doc,
|
|||
let name = item_name(&*token::get_ident_interner(), ident_str_doc);
|
||||
let def_id_doc = reader::get_doc(rp_doc,
|
||||
tag_region_param_def_def_id);
|
||||
let def_id = reader::with_doc_data(def_id_doc, parse_def_id);
|
||||
let def_id = translate_def_id(cdata, def_id);
|
||||
let def_id = translated_def_id(cdata, def_id_doc);
|
||||
|
||||
let doc = reader::get_doc(rp_doc, tag_region_param_def_space);
|
||||
let space = subst::ParamSpace::from_uint(reader::doc_as_u64(doc) as usize);
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ fn encode_impl_type_basename(rbml_w: &mut Encoder, name: ast::Name) {
|
|||
rbml_w.wr_tagged_str(tag_item_impl_type_basename, &token::get_name(name));
|
||||
}
|
||||
|
||||
pub fn encode_def_id(rbml_w: &mut Encoder, id: DefId) {
|
||||
rbml_w.wr_tagged_str(tag_def_id, &def_to_string(id));
|
||||
fn encode_def_id(rbml_w: &mut Encoder, id: DefId) {
|
||||
rbml_w.wr_tagged_u64(tag_def_id, def_to_u64(id));
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
@ -122,6 +122,10 @@ fn encode_family(rbml_w: &mut Encoder, c: char) {
|
|||
rbml_w.wr_tagged_u8(tag_items_data_item_family, c as u8);
|
||||
}
|
||||
|
||||
pub fn def_to_u64(did: DefId) -> u64 {
|
||||
(did.krate as u64) << 32 | (did.node as u64)
|
||||
}
|
||||
|
||||
pub fn def_to_string(did: DefId) -> String {
|
||||
format!("{}:{}", did.krate, did.node)
|
||||
}
|
||||
|
|
@ -153,9 +157,9 @@ fn encode_bounds_and_type<'a, 'tcx>(rbml_w: &mut Encoder,
|
|||
}
|
||||
|
||||
fn encode_variant_id(rbml_w: &mut Encoder, vid: DefId) {
|
||||
let s = def_to_string(vid);
|
||||
rbml_w.wr_tagged_str(tag_items_data_item_variant, &s[..]);
|
||||
rbml_w.wr_tagged_str(tag_mod_child, &s[..]);
|
||||
let id = def_to_u64(vid);
|
||||
rbml_w.wr_tagged_u64(tag_items_data_item_variant, id);
|
||||
rbml_w.wr_tagged_u64(tag_mod_child, id);
|
||||
}
|
||||
|
||||
pub fn write_closure_type<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
|
||||
|
|
@ -260,7 +264,7 @@ fn encode_disr_val(_: &EncodeContext,
|
|||
}
|
||||
|
||||
fn encode_parent_item(rbml_w: &mut Encoder, id: DefId) {
|
||||
rbml_w.wr_tagged_str(tag_items_data_parent_item, &def_to_string(id));
|
||||
rbml_w.wr_tagged_u64(tag_items_data_parent_item, def_to_u64(id));
|
||||
}
|
||||
|
||||
fn encode_struct_fields(rbml_w: &mut Encoder,
|
||||
|
|
@ -275,7 +279,7 @@ fn encode_struct_fields(rbml_w: &mut Encoder,
|
|||
}
|
||||
encode_struct_field_family(rbml_w, f.vis);
|
||||
encode_def_id(rbml_w, f.id);
|
||||
rbml_w.wr_tagged_str(tag_item_field_origin, &def_to_string(origin));
|
||||
rbml_w.wr_tagged_u64(tag_item_field_origin, def_to_u64(origin));
|
||||
rbml_w.end_tag();
|
||||
}
|
||||
}
|
||||
|
|
@ -358,8 +362,8 @@ fn encode_reexported_static_method(rbml_w: &mut Encoder,
|
|||
debug!("(encode reexported static method) {}::{}",
|
||||
exp.name, token::get_name(method_name));
|
||||
rbml_w.start_tag(tag_items_data_item_reexport);
|
||||
rbml_w.wr_tagged_str(tag_items_data_item_reexport_def_id,
|
||||
&def_to_string(method_def_id));
|
||||
rbml_w.wr_tagged_u64(tag_items_data_item_reexport_def_id,
|
||||
def_to_u64(method_def_id));
|
||||
rbml_w.wr_tagged_str(tag_items_data_item_reexport_name,
|
||||
&format!("{}::{}", exp.name,
|
||||
token::get_name(method_name)));
|
||||
|
|
@ -495,8 +499,8 @@ fn encode_reexports(ecx: &EncodeContext,
|
|||
exp.def_id.node,
|
||||
id);
|
||||
rbml_w.start_tag(tag_items_data_item_reexport);
|
||||
rbml_w.wr_tagged_str(tag_items_data_item_reexport_def_id,
|
||||
&def_to_string(exp.def_id));
|
||||
rbml_w.wr_tagged_u64(tag_items_data_item_reexport_def_id,
|
||||
def_to_u64(exp.def_id));
|
||||
rbml_w.wr_tagged_str(tag_items_data_item_reexport_name,
|
||||
exp.name.as_str());
|
||||
rbml_w.end_tag();
|
||||
|
|
@ -526,12 +530,12 @@ fn encode_info_for_mod(ecx: &EncodeContext,
|
|||
|
||||
// Encode info about all the module children.
|
||||
for item in &md.items {
|
||||
rbml_w.wr_tagged_str(tag_mod_child,
|
||||
&def_to_string(local_def(item.id)));
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(local_def(item.id)));
|
||||
|
||||
each_auxiliary_node_id(&**item, |auxiliary_node_id| {
|
||||
rbml_w.wr_tagged_str(tag_mod_child,
|
||||
&def_to_string(local_def(auxiliary_node_id)));
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(local_def(auxiliary_node_id)));
|
||||
true
|
||||
});
|
||||
|
||||
|
|
@ -541,8 +545,7 @@ fn encode_info_for_mod(ecx: &EncodeContext,
|
|||
token::get_ident(ident),
|
||||
did, ecx.tcx.map.node_to_string(did));
|
||||
|
||||
rbml_w.wr_tagged_str(tag_mod_impl,
|
||||
&def_to_string(local_def(did)));
|
||||
rbml_w.wr_tagged_u64(tag_mod_impl, def_to_u64(local_def(did)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -619,8 +622,7 @@ fn encode_parent_sort(rbml_w: &mut Encoder, sort: char) {
|
|||
fn encode_provided_source(rbml_w: &mut Encoder,
|
||||
source_opt: Option<DefId>) {
|
||||
if let Some(source) = source_opt {
|
||||
rbml_w.wr_tagged_str(tag_item_method_provided_source,
|
||||
&def_to_string(source));
|
||||
rbml_w.wr_tagged_u64(tag_item_method_provided_source, def_to_u64(source));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -725,8 +727,8 @@ fn encode_generics<'a, 'tcx>(rbml_w: &mut Encoder,
|
|||
encode_name(rbml_w, param.name);
|
||||
rbml_w.end_tag();
|
||||
|
||||
rbml_w.wr_tagged_str(tag_region_param_def_def_id,
|
||||
&def_to_string(param.def_id));
|
||||
rbml_w.wr_tagged_u64(tag_region_param_def_def_id,
|
||||
def_to_u64(param.def_id));
|
||||
|
||||
rbml_w.wr_tagged_u64(tag_region_param_def_space,
|
||||
param.space.to_uint() as u64);
|
||||
|
|
@ -1089,8 +1091,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
|||
|
||||
// Encode all the items in this module.
|
||||
for foreign_item in &fm.items {
|
||||
rbml_w.wr_tagged_str(tag_mod_child,
|
||||
&def_to_string(local_def(foreign_item.id)));
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(local_def(foreign_item.id)));
|
||||
}
|
||||
encode_visibility(rbml_w, vis);
|
||||
encode_stability(rbml_w, stab);
|
||||
|
|
@ -1335,8 +1337,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
|
|||
}
|
||||
rbml_w.end_tag();
|
||||
|
||||
rbml_w.wr_tagged_str(tag_mod_child,
|
||||
&def_to_string(method_def_id.def_id()));
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(method_def_id.def_id()));
|
||||
}
|
||||
encode_path(rbml_w, path.clone());
|
||||
|
||||
|
|
@ -1932,12 +1934,12 @@ fn encode_misc_info(ecx: &EncodeContext,
|
|||
rbml_w.start_tag(tag_misc_info);
|
||||
rbml_w.start_tag(tag_misc_info_crate_items);
|
||||
for item in &krate.module.items {
|
||||
rbml_w.wr_tagged_str(tag_mod_child,
|
||||
&def_to_string(local_def(item.id)));
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(local_def(item.id)));
|
||||
|
||||
each_auxiliary_node_id(&**item, |auxiliary_node_id| {
|
||||
rbml_w.wr_tagged_str(tag_mod_child,
|
||||
&def_to_string(local_def(auxiliary_node_id)));
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(local_def(auxiliary_node_id)));
|
||||
true
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue