diff --git a/0004-Disable-some-more-unsupported-stuff-in-libcore.patch b/0004-Disable-some-more-unsupported-stuff-in-libcore.patch index c265db96a26..1310b95749d 100644 --- a/0004-Disable-some-more-unsupported-stuff-in-libcore.patch +++ b/0004-Disable-some-more-unsupported-stuff-in-libcore.patch @@ -4,37 +4,8 @@ Date: Thu, 23 Aug 2018 11:15:01 +0200 Subject: [PATCH] Disable some more unsupported stuff in libcore --- - src/libcore/cmp.rs | 5 ++++- src/libcore/num/mod.rs | 8 ++++++-- - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs -index a6e6496..f9374ea 100644 ---- a/src/libcore/cmp.rs -+++ b/src/libcore/cmp.rs -@@ -496,6 +496,7 @@ pub trait Ord: Eq + PartialOrd { - #[stable(feature = "rust1", since = "1.0.0")] - impl Eq for Ordering {} - -+/* - #[stable(feature = "rust1", since = "1.0.0")] - impl Ord for Ordering { - #[inline] -@@ -503,12 +504,14 @@ impl Ord for Ordering { - (*self as i32).cmp(&(*other as i32)) - } - } -+*/ - - #[stable(feature = "rust1", since = "1.0.0")] - impl PartialOrd for Ordering { - #[inline] - fn partial_cmp(&self, other: &Ordering) -> Option { -- (*self as i32).partial_cmp(&(*other as i32)) -+ //(*self as i32).partial_cmp(&(*other as i32)) -+ None - } - } + 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 5d00949..f077f1d 100644 diff --git a/src/base.rs b/src/base.rs index 0f6bbca78e6..35fbf6454e9 100644 --- a/src/base.rs +++ b/src/base.rs @@ -571,6 +571,10 @@ fn trans_stmt<'a, 'tcx: 'a>( }; lval.write_cvalue(fx, CValue::ByVal(res, dest_layout)); } + (ty::Adt(adt_def, _substs), ty::Uint(_)) | (ty::Adt(adt_def, _substs), ty::Int(_)) if adt_def.is_enum() => { + let discr = trans_get_discriminant(fx, operand, fx.layout_of(to_ty)); + lval.write_cvalue(fx, discr); + } _ => unimpl!("rval misc {:?} {:?}", from_ty, to_ty), } }