Skip to content

Commit

Permalink
Rebase fallout
Browse files Browse the repository at this point in the history
Because certain somebody sucks at resolving big conflicts
  • Loading branch information
nagisa committed Feb 11, 2017
1 parent f3bd723 commit b663d9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/librustc/ty/layout.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/librustc_metadata/decoder.rs
Expand Up @@ -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| {
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_metadata/encoder.rs
Expand Up @@ -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();

Expand Down

0 comments on commit b663d9d

Please sign in to comment.