Rebase fallout
Because certain somebody sucks at resolving big conflicts
This commit is contained in:
parent
f3bd723101
commit
b663d9d5e8
|
@ -1190,9 +1190,7 @@ impl<'a, 'gcx, 'tcx> Layout {
|
|||
|
||||
// FIXME: should handle i128? signed-value based impl is weird and hard to
|
||||
// grok.
|
||||
let (discr, signed) = Integer::repr_discr(tcx, ty, &hints[..],
|
||||
min,
|
||||
max);
|
||||
let (discr, signed) = Integer::repr_discr(tcx, ty, &def.repr, min, max);
|
||||
return success(CEnum {
|
||||
discr: discr,
|
||||
signed: signed,
|
||||
|
@ -1309,7 +1307,7 @@ impl<'a, 'gcx, 'tcx> Layout {
|
|||
// The general case.
|
||||
let discr_max = (variants.len() - 1) as i64;
|
||||
assert!(discr_max >= 0);
|
||||
let (min_ity, _) = Integer::repr_discr(tcx, ty, &hints[..], 0, discr_max);
|
||||
let (min_ity, _) = Integer::repr_discr(tcx, ty, &def.repr, 0, discr_max);
|
||||
let mut align = dl.aggregate_align;
|
||||
let mut size = Size::from_bytes(0);
|
||||
|
||||
|
|
|
@ -546,12 +546,12 @@ impl<'a, 'tcx> CrateMetadata {
|
|||
let did = self.local_def_id(item_id);
|
||||
let (kind, ty) = match item.kind {
|
||||
EntryKind::Enum(dt, _) => (ty::AdtKind::Enum, Some(dt.decode(self))),
|
||||
EntryKind::Struct(_) => (ty::AdtKind::Struct, None),
|
||||
EntryKind::Union(_) => (ty::AdtKind::Union, None),
|
||||
EntryKind::Struct(_, _) => (ty::AdtKind::Struct, None),
|
||||
EntryKind::Union(_, _) => (ty::AdtKind::Union, None),
|
||||
_ => bug!("get_adt_def called on a non-ADT {:?}", did),
|
||||
};
|
||||
let mut ctor_index = None;
|
||||
let variants = if let EntryKind::Enum(_) = item.kind {
|
||||
let variants = if let ty::AdtKind::Enum = kind {
|
||||
item.children
|
||||
.decode(self)
|
||||
.map(|index| {
|
||||
|
|
|
@ -661,7 +661,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
}
|
||||
hir::ItemForeignMod(_) => EntryKind::ForeignMod,
|
||||
hir::ItemTy(..) => EntryKind::Type,
|
||||
hir::ItemEnum(..) => EntryKind::Enum(self.lazy(&tcx.lookup_adt_def(def_id).discr_ty), get_repr_options(&tcx, def_id)),
|
||||
hir::ItemEnum(..) => EntryKind::Enum(self.lazy(&tcx.lookup_adt_def(def_id).discr_ty),
|
||||
get_repr_options(&tcx, def_id)),
|
||||
hir::ItemStruct(ref struct_def, _) => {
|
||||
let variant = tcx.lookup_adt_def(def_id).struct_variant();
|
||||
|
||||
|
|
Loading…
Reference in New Issue