]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_const_eval/src/interpret/operand.rs
allow for failure of subst_normalize_erasing_regions in const_eval
[rust.git] / compiler / rustc_const_eval / src / interpret / operand.rs
index de9e94ce2ac0c820137e5edcb9c3f68ce20f848e..e82ce73c814ff1a65f9aae47b180b1f61c1d326d 100644 (file)
@@ -512,7 +512,7 @@ pub fn eval_place_to_op(
             self.param_env,
             self.layout_of(self.subst_from_current_frame_and_normalize_erasing_regions(
                 place.ty(&self.frame().body.local_decls, *self.tcx).ty
-            ))?,
+            )?)?,
             op.layout,
         ));
         Ok(op)
@@ -534,7 +534,7 @@ pub fn eval_operand(
 
             Constant(ref constant) => {
                 let val =
-                    self.subst_from_current_frame_and_normalize_erasing_regions(constant.literal);
+                    self.subst_from_current_frame_and_normalize_erasing_regions(constant.literal)?;
                 // This can still fail:
                 // * During ConstProp, with `TooGeneric` or since the `requried_consts` were not all
                 //   checked yet.