diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-01-29 09:17:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-29 09:17:38 +0900 |
| commit | 046a414c19cdbec02cf6809f4d25e53057a3a1c9 (patch) | |
| tree | e34acc2848b27a35487254abc7eeb82ced800f15 /compiler/rustc_codegen_ssa/src | |
| parent | 94e093ab9775946983cec2ac7547f61db3064a40 (diff) | |
| parent | 48f9dbfd59356f865f81ce674eefdbab2d7c3cbb (diff) | |
| download | rust-046a414c19cdbec02cf6809f4d25e53057a3a1c9.tar.gz rust-046a414c19cdbec02cf6809f4d25e53057a3a1c9.zip | |
Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
clean up some const error reporting around promoteds These are some error reporting simplifications enabled by https://github.com/rust-lang/rust/pull/80579. Further simplifications are possible but could be blocked on making `const_err` a hard error. r? ``````@oli-obk``````
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/constant.rs | 7 |
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), |
