about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-07-20 08:53:09 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-07-20 08:53:09 +0000
commitc7428d50520446ccd44ca89bbbf4ff7a4725570e (patch)
tree72425a8094915722c16d07a3c046cdf07c9e3d56 /compiler/rustc_codegen_ssa/src
parent9e5a67e57f715ec5eda915db1261cdf4c4a04642 (diff)
downloadrust-c7428d50520446ccd44ca89bbbf4ff7a4725570e.tar.gz
rust-c7428d50520446ccd44ca89bbbf4ff7a4725570e.zip
Monomorphize constants before inspecting them
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/constant.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/constant.rs b/compiler/rustc_codegen_ssa/src/mir/constant.rs
index 47a166e4e1b..babcf9bee24 100644
--- a/compiler/rustc_codegen_ssa/src/mir/constant.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/constant.rs
@@ -65,7 +65,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         &self,
         constant: &mir::Constant<'tcx>,
     ) -> Result<Option<ty::ValTree<'tcx>>, ErrorHandled> {
-        let uv = match constant.literal {
+        let uv = match self.monomorphize(constant.literal) {
             mir::ConstantKind::Unevaluated(uv, _) => uv.shrink(),
             mir::ConstantKind::Ty(c) => match c.kind() {
                 // A constant that came from a const generic but was then used as an argument to old-style