]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/mir/mod.rs
rustc: replace Res in hir::Upvar with only Local/Upvar data.
[rust.git] / src / librustc / mir / mod.rs
index d2cfcdcf158ea04883bec302c84ccac51eef1d13..1f29b370d272930875d8d016766838b47b345bc6 100644 (file)
@@ -1669,10 +1669,7 @@ pub fn fmt_successor_labels(&self) -> Vec<Cow<'static, str>> {
                         .map(|&u| {
                             tcx.mk_const(ty::Const {
                                 val: ConstValue::Scalar(
-                                    Scalar::Bits {
-                                        bits: u,
-                                        size: size.bytes() as u8,
-                                    }.into(),
+                                    Scalar::from_uint(u, size).into(),
                                 ),
                                 ty: switch_ty,
                             }).to_string().into()
@@ -2040,7 +2037,7 @@ pub fn elem(self, elem: PlaceElem<'tcx>) -> Place<'tcx> {
     /// a single deref of a local.
     //
     // FIXME: can we safely swap the semantics of `fn base_local` below in here instead?
-    pub fn local(&self) -> Option<Local> {
+    pub fn local_or_deref_local(&self) -> Option<Local> {
         match self {
             Place::Base(PlaceBase::Local(local)) |
             Place::Projection(box Projection {
@@ -2566,7 +2563,7 @@ fn fmt_tuple(fmt: &mut Formatter<'_>, places: &[Operand<'_>]) -> fmt::Result {
 
                             if let Some(upvars) = tcx.upvars(def_id) {
                                 for (upvar, place) in upvars.iter().zip(places) {
-                                    let var_name = tcx.hir().name_by_hir_id(upvar.var_id());
+                                    let var_name = tcx.hir().name_by_hir_id(upvar.var_id);
                                     struct_fmt.field(&var_name.as_str(), place);
                                 }
                             }
@@ -2585,7 +2582,7 @@ fn fmt_tuple(fmt: &mut Formatter<'_>, places: &[Operand<'_>]) -> fmt::Result {
 
                             if let Some(upvars) = tcx.upvars(def_id) {
                                 for (upvar, place) in upvars.iter().zip(places) {
-                                    let var_name = tcx.hir().name_by_hir_id(upvar.var_id());
+                                    let var_name = tcx.hir().name_by_hir_id(upvar.var_id);
                                     struct_fmt.field(&var_name.as_str(), place);
                                 }
                             }