]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir/src/transform/check_consts/validation.rs
Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
[rust.git] / compiler / rustc_mir / src / transform / check_consts / validation.rs
index 2845f27d22babc8a752d7828da4396392cd2a1e8..dd3e28acf96e3f9103b5dabd5026b34b40b64016 100644 (file)
@@ -222,7 +222,7 @@ pub fn check_body(&mut self) {
 
         // `async` functions cannot be `const fn`. This is checked during AST lowering, so there's
         // no need to emit duplicate errors here.
-        if is_async_fn(self.ccx) || body.generator_kind.is_some() {
+        if is_async_fn(self.ccx) || body.generator.is_some() {
             tcx.sess.delay_span_bug(body.span, "`async` functions cannot be `const fn`");
             return;
         }
@@ -684,8 +684,8 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
                 }
             }
 
-            Rvalue::BinaryOp(op, ref lhs, ref rhs)
-            | Rvalue::CheckedBinaryOp(op, ref lhs, ref rhs) => {
+            Rvalue::BinaryOp(op, box (ref lhs, ref rhs))
+            | Rvalue::CheckedBinaryOp(op, box (ref lhs, ref rhs)) => {
                 let lhs_ty = lhs.ty(self.body, self.tcx);
                 let rhs_ty = rhs.ty(self.body, self.tcx);