From: bors Date: Sat, 13 Aug 2016 08:20:46 +0000 (-0700) Subject: Auto merge of #35348 - scottcarr:discriminant2, r=nikomatsakis X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=e64f68817d850ccbe642d7f067083bc655115d84;p=rust.git Auto merge of #35348 - scottcarr:discriminant2, r=nikomatsakis [MIR] Add explicit SetDiscriminant StatementKind for deaggregating enums cc #35186 To deaggregate enums, we need to be able to explicitly set the discriminant. This PR implements a new StatementKind that does that. I think some of the places that have `panics!` now could maybe do something smarter. --- e64f68817d850ccbe642d7f067083bc655115d84 diff --cc src/librustc_mir/transform/type_check.rs index 52f41741b08,026d197cb7f..934357c9e1d --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@@ -12,9 -12,9 +12,9 @@@ #![allow(unreachable_code)] use rustc::infer::{self, InferCtxt, InferOk}; -use rustc::traits::{self, ProjectionMode}; +use rustc::traits::{self, Reveal}; use rustc::ty::fold::TypeFoldable; - use rustc::ty::{self, Ty, TyCtxt}; + use rustc::ty::{self, Ty, TyCtxt, TypeVariants}; use rustc::mir::repr::*; use rustc::mir::tcx::LvalueTy; use rustc::mir::transform::{MirPass, MirSource, Pass};