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_cranelift/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_cranelift/src')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/constant.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs index beff84fb2e2..5702832bcb6 100644 --- a/compiler/rustc_codegen_cranelift/src/constant.rs +++ b/compiler/rustc_codegen_cranelift/src/constant.rs @@ -134,11 +134,9 @@ pub(crate) fn codegen_constant<'tcx>( { Ok(const_val) => const_val, Err(_) => { - if promoted.is_none() { - fx.tcx - .sess - .span_err(constant.span, "erroneous constant encountered"); - } + fx.tcx + .sess + .span_err(constant.span, "erroneous constant encountered"); return crate::trap::trap_unreachable_ret_value( fx, fx.layout_of(const_.ty), |
