Fix rebase

This commit is contained in:
Vadim Petrochenkov 2016-08-22 15:17:05 +03:00
parent 0cb19389b0
commit 2dc2fc5fc5

View File

@ -1029,6 +1029,33 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
def_to_u64(ctor_did)); def_to_u64(ctor_did));
} }
} }
hir::ItemUnion(..) => {
let def = ecx.tcx.lookup_adt_def(def_id);
let variant = def.struct_variant();
encode_def_id_and_key(ecx, self.rbml_w, def_id);
encode_family(self.rbml_w, 'U');
self.encode_bounds_and_type_for_item(item.id);
encode_item_variances(self.rbml_w, ecx, item.id);
encode_name(self.rbml_w, item.name);
encode_attributes(self.rbml_w, &item.attrs);
encode_stability(self.rbml_w, stab);
encode_deprecation(self.rbml_w, depr);
self.encode_visibility(vis);
self.encode_repr_attrs(&item.attrs);
/* Encode def_ids for each field and method
for methods, write all the stuff get_trait_method
needs to know*/
self.encode_struct_fields(variant);
encode_inlined_item(ecx, self.rbml_w, InlinedItemRef::Item(def_id, item));
self.encode_mir(item.id);
// Encode inherent implementations for self union.
encode_inherent_implementations(ecx, self.rbml_w, def_id);
}
hir::ItemDefaultImpl(unsafety, _) => { hir::ItemDefaultImpl(unsafety, _) => {
encode_def_id_and_key(ecx, self.rbml_w, def_id); encode_def_id_and_key(ecx, self.rbml_w, def_id);
encode_family(self.rbml_w, 'd'); encode_family(self.rbml_w, 'd');
@ -1180,7 +1207,7 @@ impl<'a, 'tcx, 'encoder> IndexBuilder<'a, 'tcx, 'encoder> {
self.encode_addl_struct_info(def_id, struct_def.id(), item); self.encode_addl_struct_info(def_id, struct_def.id(), item);
} }
hir::ItemUnion(..) => { hir::ItemUnion(..) => {
unimplemented_unions!(); self.encode_addl_union_info(def_id);
} }
hir::ItemImpl(_, _, _, _, _, ref ast_items) => { hir::ItemImpl(_, _, _, _, _, ref ast_items) => {
self.encode_addl_impl_info(def_id, item.id, ast_items); self.encode_addl_impl_info(def_id, item.id, ast_items);
@ -1217,6 +1244,10 @@ impl<'a, 'tcx, 'encoder> IndexBuilder<'a, 'tcx, 'encoder> {
} }
} }
fn encode_addl_union_info(&mut self, def_id: DefId) {
self.encode_fields(def_id);
}
fn encode_addl_impl_info(&mut self, fn encode_addl_impl_info(&mut self,
def_id: DefId, def_id: DefId,
impl_id: ast::NodeId, impl_id: ast::NodeId,