Monomorphize constants before inspecting them

This commit is contained in:
Oli Scherer
2023-07-20 08:53:09 +00:00
parent 9e5a67e57f
commit c7428d5052
2 changed files with 5 additions and 2 deletions
@@ -65,7 +65,7 @@ pub fn eval_unevaluated_mir_constant_to_valtree(
&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
+4 -1
View File
@@ -1,4 +1,7 @@
//run-pass
// run-pass
// revisions: opt noopt
//[noopt] compile-flags: -Copt-level=0
//[opt] compile-flags: -O
#![feature(repr_simd, platform_intrinsics)]
#![allow(incomplete_features)]
#![feature(adt_const_params)]