Monomorphize constants before inspecting them
This commit is contained in:
parent
9e5a67e57f
commit
c7428d5052
@ -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
|
||||
|
@ -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)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user