diff options
| author | bors <bors@rust-lang.org> | 2021-03-21 03:36:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-03-21 03:36:22 +0000 |
| commit | bbf07c0b4f210ced7bd2785ab554e0d805644235 (patch) | |
| tree | bdaa957d4632277cb8db05193f7e9b5caf7ac5a8 /compiler/rustc_codegen_cranelift/src | |
| parent | ed4005da44b0dcbeaa35951ef994da82e156258f (diff) | |
| parent | 69f6a195da5f7ed66bfde728f3feafdc621a6460 (diff) | |
| download | rust-bbf07c0b4f210ced7bd2785ab554e0d805644235.tar.gz rust-bbf07c0b4f210ced7bd2785ab554e0d805644235.zip | |
Auto merge of #83333 - Dylan-DPC:rollup-0rdt6sz, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #82707 (const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable`) - #83040 (extract `ConstKind::Unevaluated` into a struct) - #83280 (Fix pluralization in keyword docs) - #83289 (Move some tests to more reasonable directories - 5) - #83306 (Extend `proc_macro_back_compat` lint to `js-sys`) - #83327 (Extend comment in `UsedLocals::visit_lhs`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/constant.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs index 9d93370b7d0..f4cbfb6967f 100644 --- a/compiler/rustc_codegen_cranelift/src/constant.rs +++ b/compiler/rustc_codegen_cranelift/src/constant.rs @@ -45,9 +45,9 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool { }; match const_.val { ConstKind::Value(_) => {} - ConstKind::Unevaluated(def, ref substs, promoted) => { + ConstKind::Unevaluated(unevaluated) => { if let Err(err) = - fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def, substs, promoted, None) + fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated, None) { all_constants_ok = false; match err { @@ -122,14 +122,14 @@ pub(crate) fn codegen_constant<'tcx>( }; let const_val = match const_.val { ConstKind::Value(const_val) => const_val, - ConstKind::Unevaluated(def, ref substs, promoted) if fx.tcx.is_static(def.did) => { + ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }) if fx.tcx.is_static(def.did) => { assert!(substs.is_empty()); assert!(promoted.is_none()); return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty)).to_cvalue(fx); } - ConstKind::Unevaluated(def, ref substs, promoted) => { - match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def, substs, promoted, None) { + ConstKind::Unevaluated(unevaluated) => { + match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated, None) { Ok(const_val) => const_val, Err(_) => { span_bug!(constant.span, "erroneous constant not captured by required_consts"); |
