about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-21 12:04:33 +0000
committerbors <bors@rust-lang.org>2023-09-21 12:04:33 +0000
commit66ab7e6883c563ceacf8386a50e851e9855cd6b4 (patch)
treec8206b6a97130fb396796c98f7bb9a1cd3df77df /compiler/rustc_codegen_cranelift/src
parente4a361a48a59ead52b302aaa2e1d9d345264935a (diff)
parente9aee820b310e82c7c86ecd7fd931c6f3c51350f (diff)
downloadrust-66ab7e6883c563ceacf8386a50e851e9855cd6b4.tar.gz
rust-66ab7e6883c563ceacf8386a50e851e9855cd6b4.zip
Auto merge of #116027 - GuillaumeGomez:rollup-3zdi9lf, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #115257 (Improve invalid UTF-8 lint by finding the expression initializer)
 - #115936 (Prevent promotion of const fn calls in inline consts)
 - #115972 (rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const)
 - #116007 (Call panic_display directly in const_panic_fmt.)
 - #116019 (Delete obsolete `--disable-per-crate-search` rustdoc flag)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
-rw-r--r--compiler/rustc_codegen_cranelift/src/constant.rs6
-rw-r--r--compiler/rustc_codegen_cranelift/src/inline_asm.rs4
2 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 151674b2d6d..14b10ed8b9a 100644
--- a/compiler/rustc_codegen_cranelift/src/constant.rs
+++ b/compiler/rustc_codegen_cranelift/src/constant.rs
@@ -64,9 +64,9 @@ pub(crate) fn codegen_tls_ref<'tcx>(
 
 pub(crate) fn eval_mir_constant<'tcx>(
     fx: &FunctionCx<'_, '_, 'tcx>,
-    constant: &Constant<'tcx>,
+    constant: &ConstOperand<'tcx>,
 ) -> (ConstValue<'tcx>, Ty<'tcx>) {
-    let cv = fx.monomorphize(constant.literal);
+    let cv = fx.monomorphize(constant.const_);
     // This cannot fail because we checked all required_consts in advance.
     let val = cv
         .eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
@@ -76,7 +76,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
 
 pub(crate) fn codegen_constant_operand<'tcx>(
     fx: &mut FunctionCx<'_, '_, 'tcx>,
-    constant: &Constant<'tcx>,
+    constant: &ConstOperand<'tcx>,
 ) -> CValue<'tcx> {
     let (const_val, ty) = eval_mir_constant(fx, constant);
     codegen_const_value(fx, const_val, ty)
diff --git a/compiler/rustc_codegen_cranelift/src/inline_asm.rs b/compiler/rustc_codegen_cranelift/src/inline_asm.rs
index eba90949b5e..50bbf8105fd 100644
--- a/compiler/rustc_codegen_cranelift/src/inline_asm.rs
+++ b/compiler/rustc_codegen_cranelift/src/inline_asm.rs
@@ -252,8 +252,8 @@ pub(crate) fn codegen_inline_asm<'tcx>(
                 CInlineAsmOperand::Const { value }
             }
             InlineAsmOperand::SymFn { ref value } => {
-                let literal = fx.monomorphize(value.literal);
-                if let ty::FnDef(def_id, args) = *literal.ty().kind() {
+                let const_ = fx.monomorphize(value.const_);
+                if let ty::FnDef(def_id, args) = *const_.ty().kind() {
                     let instance = ty::Instance::resolve_for_fn_ptr(
                         fx.tcx,
                         ty::ParamEnv::reveal_all(),