pub const tag_crate_dep_hash: usize = 0x37;
pub const tag_crate_dep_explicitly_linked: usize = 0x38; // top-level only
-pub const tag_mod_impl: usize = 0x39;
-
pub const tag_item_trait_item: usize = 0x3a;
pub const tag_item_trait_ref: usize = 0x3b;
pub const tag_path_elem_mod: usize = 0x3f;
pub const tag_path_elem_name: usize = 0x40;
pub const tag_item_field: usize = 0x41;
-pub const tag_item_field_origin: usize = 0x42;
pub const tag_item_variances: usize = 0x43;
/*
tag_tree = 0x51,
- tag_id_range = 0x52,
-
+ // GAP 0x52
tag_table = 0x53,
// GAP 0x54, 0x55
tag_table_def = 0x56,
tag_table_freevars = 0x59,
tag_table_tcache = 0x5a,
tag_table_param_defs = 0x5b,
- tag_table_mutbl = 0x5c,
- tag_table_last_use = 0x5d,
- tag_table_spill = 0x5e,
+ // GAP 0x5c, 0x5d, 0x5e
tag_table_method_map = 0x5f,
- tag_table_vtable_map = 0x60,
+ // GAP 0x60
tag_table_adjustments = 0x61,
- tag_table_moves_map = 0x62,
- tag_table_capture_map = 0x63,
+ // GAP 0x62, 0x63
tag_table_closure_tys = 0x64,
tag_table_closure_kinds = 0x65,
tag_table_upvar_capture_map = 0x66,
- tag_table_capture_modes = 0x67,
- // GAP 0x68
+ // GAP 0x67, 0x68
tag_table_const_qualif = 0x69,
tag_table_cast_kinds = 0x6a,
}
pub const tag_item_trait_item_sort: usize = 0x70;
-pub const tag_item_trait_parent_sort: usize = 0x71;
-
-pub const tag_item_impl_type_basename: usize = 0x72;
-
pub const tag_crate_triple: usize = 0x105; // top-level only
pub const tag_dylib_dependency_formats: usize = 0x106; // top-level only
pub const tag_item_unnamed_field: usize = 0x77;
pub const tag_items_data_item_visibility: usize = 0x78;
-pub const tag_item_method_tps: usize = 0x79;
+// GAP 0x79
pub const tag_item_method_fty: usize = 0x7a;
pub const tag_mod_child: usize = 0x7b;
pub const tag_misc_info_crate_items: usize = 0x7c;
// GAP 0x7d
-pub const tag_item_impl_vtables: usize = 0x7e;
+// GAP 0x7e
pub const tag_impls: usize = 0x109; // top-level only
pub const tag_impls_impl: usize = 0x7f;
rbml_w.wr_tagged_str(tag_paths_data_name, &name.as_str());
}
-fn encode_impl_type_basename(rbml_w: &mut Encoder, name: Name) {
- rbml_w.wr_tagged_str(tag_item_impl_type_basename, &name.as_str());
-}
-
fn encode_def_id(rbml_w: &mut Encoder, id: DefId) {
rbml_w.wr_tagged_u64(tag_def_id, def_to_u64(id));
}
}
fn encode_struct_fields(rbml_w: &mut Encoder,
- variant: ty::VariantDef,
- origin: DefId) {
+ variant: ty::VariantDef) {
for f in &variant.fields {
if f.name == special_idents::unnamed_field.name {
rbml_w.start_tag(tag_item_unnamed_field);
}
encode_struct_field_family(rbml_w, f.vis);
encode_def_id(rbml_w, f.did);
- rbml_w.wr_tagged_u64(tag_item_field_origin, def_to_u64(origin));
rbml_w.end_tag();
}
}
let stab = stability::lookup(ecx.tcx, vid);
encode_stability(rbml_w, stab);
- encode_struct_fields(rbml_w, variant, vid);
+ encode_struct_fields(rbml_w, variant);
let specified_disr_val = variant.disr_val;
if specified_disr_val != disr_val {
def_to_u64(DefId::local(auxiliary_node_id)));
true
});
-
- if let hir::ItemImpl(..) = item.node {
- let (name, did) = (item.name, item.id);
- debug!("(encoding info for module) ... encoding impl {} ({}/{})",
- name,
- did, ecx.tcx.map.node_to_string(did));
-
- rbml_w.wr_tagged_u64(tag_mod_impl, def_to_u64(DefId::local(did)));
- }
}
encode_path(rbml_w, path.clone());
rbml_w.wr_tagged_u8(tag_item_trait_item_sort, sort as u8);
}
-fn encode_parent_sort(rbml_w: &mut Encoder, sort: char) {
- rbml_w.wr_tagged_u8(tag_item_trait_parent_sort, sort as u8);
-}
-
fn encode_field<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
rbml_w: &mut Encoder,
field: ty::FieldDef<'tcx>,
/* Encode def_ids for each field and method
for methods, write all the stuff get_trait_method
needs to know*/
- encode_struct_fields(rbml_w, variant, def_id);
+ encode_struct_fields(rbml_w, variant);
encode_inlined_item(ecx, rbml_w, InlinedItemRef::Item(item));
encode_trait_ref(rbml_w, ecx, trait_ref, tag_item_trait_ref);
rbml_w.end_tag();
}
- hir::ItemImpl(unsafety, polarity, _, _, ref ty, ref ast_items) => {
+ hir::ItemImpl(unsafety, polarity, _, _, _, ref ast_items) => {
// We need to encode information about the default methods we
// have inherited, so we drive this based on the impl structure.
let impl_items = tcx.impl_items.borrow();
None => {}
}
- match ty.node {
- hir::TyPath(None, ref path) if path.segments.len() == 1 => {
- let name = path.segments.last().unwrap().identifier.name;
- encode_impl_type_basename(rbml_w, name);
- }
- _ => {}
- }
for &item_def_id in items {
rbml_w.start_tag(tag_item_impl_item);
match item_def_id {
}
}
- encode_parent_sort(rbml_w, 't');
-
let trait_item = &*ms[i];
encode_attributes(rbml_w, &trait_item.attrs);
match trait_item.node {