about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/mir
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2021-01-24 12:50:30 +0100
committerRalf Jung <post@ralfj.de>2021-01-24 13:34:34 +0100
commit48f9dbfd59356f865f81ce674eefdbab2d7c3cbb (patch)
tree32f1a61dd64449d8ae99b6e16f948f080a1e837a /compiler/rustc_codegen_ssa/src/mir
parent4d0dd02ee07bddad9136f95c9f7846ebf3eb3fc5 (diff)
downloadrust-48f9dbfd59356f865f81ce674eefdbab2d7c3cbb.tar.gz
rust-48f9dbfd59356f865f81ce674eefdbab2d7c3cbb.zip
clean up some const error reporting around promoteds
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/mir')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/constant.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/constant.rs b/compiler/rustc_codegen_ssa/src/mir/constant.rs
index 3a85c268e0e..b79a221a0e7 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),