X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=compiler%2Frustc_codegen_ssa%2Fsrc%2Fmir%2Fconstant.rs;h=b79a221a0e74acb16f08b6320bbfe2dcb0bba6fe;hb=5869c6ff7a3bf934f0bcc4de49608749c877a3d5;hp=3a85c268e0ea94d5d130933fec586027331d9f79;hpb=fc51201451a8dc06f64f11ffaf252afc6666632b;p=rustc.git diff --git a/compiler/rustc_codegen_ssa/src/mir/constant.rs b/compiler/rustc_codegen_ssa/src/mir/constant.rs index 3a85c268e0..b79a221a0e 100644 --- a/compiler/rustc_codegen_ssa/src/mir/constant.rs +++ b/compiler/rustc_codegen_ssa/src/mir/constant.rs @@ -30,12 +30,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { .tcx() .const_eval_resolve(ty::ParamEnv::reveal_all(), def, substs, promoted, None) .map_err(|err| { - if promoted.is_none() { - self.cx - .tcx() - .sess - .span_err(constant.span, "erroneous constant encountered"); - } + self.cx.tcx().sess.span_err(constant.span, "erroneous constant encountered"); err }), ty::ConstKind::Value(value) => Ok(value),