Skip to content

Commit b663d9d

Browse files
committed
Rebase fallout
Because certain somebody sucks at resolving big conflicts
1 parent f3bd723 commit b663d9d

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/librustc/ty/layout.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,7 @@ impl<'a, 'gcx, 'tcx> Layout {
11901190

11911191
// FIXME: should handle i128? signed-value based impl is weird and hard to
11921192
// grok.
1193-
let (discr, signed) = Integer::repr_discr(tcx, ty, &hints[..],
1194-
min,
1195-
max);
1193+
let (discr, signed) = Integer::repr_discr(tcx, ty, &def.repr, min, max);
11961194
return success(CEnum {
11971195
discr: discr,
11981196
signed: signed,
@@ -1309,7 +1307,7 @@ impl<'a, 'gcx, 'tcx> Layout {
13091307
// The general case.
13101308
let discr_max = (variants.len() - 1) as i64;
13111309
assert!(discr_max >= 0);
1312-
let (min_ity, _) = Integer::repr_discr(tcx, ty, &hints[..], 0, discr_max);
1310+
let (min_ity, _) = Integer::repr_discr(tcx, ty, &def.repr, 0, discr_max);
13131311
let mut align = dl.aggregate_align;
13141312
let mut size = Size::from_bytes(0);
13151313

src/librustc_metadata/decoder.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -546,12 +546,12 @@ impl<'a, 'tcx> CrateMetadata {
546546
let did = self.local_def_id(item_id);
547547
let (kind, ty) = match item.kind {
548548
EntryKind::Enum(dt, _) => (ty::AdtKind::Enum, Some(dt.decode(self))),
549-
EntryKind::Struct(_) => (ty::AdtKind::Struct, None),
550-
EntryKind::Union(_) => (ty::AdtKind::Union, None),
549+
EntryKind::Struct(_, _) => (ty::AdtKind::Struct, None),
550+
EntryKind::Union(_, _) => (ty::AdtKind::Union, None),
551551
_ => bug!("get_adt_def called on a non-ADT {:?}", did),
552552
};
553553
let mut ctor_index = None;
554-
let variants = if let EntryKind::Enum(_) = item.kind {
554+
let variants = if let ty::AdtKind::Enum = kind {
555555
item.children
556556
.decode(self)
557557
.map(|index| {

src/librustc_metadata/encoder.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
661661
}
662662
hir::ItemForeignMod(_) => EntryKind::ForeignMod,
663663
hir::ItemTy(..) => EntryKind::Type,
664-
hir::ItemEnum(..) => EntryKind::Enum(self.lazy(&tcx.lookup_adt_def(def_id).discr_ty), get_repr_options(&tcx, def_id)),
664+
hir::ItemEnum(..) => EntryKind::Enum(self.lazy(&tcx.lookup_adt_def(def_id).discr_ty),
665+
get_repr_options(&tcx, def_id)),
665666
hir::ItemStruct(ref struct_def, _) => {
666667
let variant = tcx.lookup_adt_def(def_id).struct_variant();
667668

0 commit comments

Comments
 (0)