]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/transform/const_prop.rs
Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelix
[rust.git] / src / librustc_mir / transform / const_prop.rs
index f21efaa048bb8770efdc1bf3f78d4860957e825b..cfa899eb5a62a11410e9d34b831bcca263e7eaa2 100644 (file)
@@ -47,10 +47,10 @@ fn run_pass<'a, 'tcx>(&self,
         }
 
         use rustc::hir::map::blocks::FnLikeNode;
-        let node_id = tcx.hir.as_local_node_id(source.def_id)
+        let node_id = tcx.hir().as_local_node_id(source.def_id)
                              .expect("Non-local call to local provider is_const_fn");
 
-        let is_fn_like = FnLikeNode::from_node(tcx.hir.get(node_id)).is_some();
+        let is_fn_like = FnLikeNode::from_node(tcx.hir().get(node_id)).is_some();
         let is_assoc_const = match tcx.describe_def(source.def_id) {
             Some(Def::AssociatedConst(_)) => true,
             _ => false,
@@ -289,7 +289,7 @@ fn eval_place(&mut self, place: &Place<'tcx>, source_info: SourceInfo) -> Option
                     })?;
                     Some((res, span))
                 },
-                // We could get more projections by using e.g. `operand_projection`,
+                // We could get more projections by using e.g., `operand_projection`,
                 // but we do not even have the stack frame set up properly so
                 // an `Index` projection would throw us off-track.
                 _ => None,
@@ -346,7 +346,7 @@ fn const_prop(
             Rvalue::Cast(kind, ref operand, _) => {
                 let (op, span) = self.eval_operand(operand, source_info)?;
                 self.use_ecx(source_info, |this| {
-                    let dest = this.ecx.allocate(place_layout, MemoryKind::Stack)?;
+                    let dest = this.ecx.allocate(place_layout, MemoryKind::Stack);
                     this.ecx.cast(op, kind, dest.into())?;
                     Ok((dest.into(), span))
                 })
@@ -618,7 +618,7 @@ fn visit_terminator_kind(
                         .span;
                     let node_id = self
                         .tcx
-                        .hir
+                        .hir()
                         .as_local_node_id(self.source.def_id)
                         .expect("some part of a failing const eval must be local");
                     use rustc::mir::interpret::EvalErrorKind::*;