Skip to content

Commit

Permalink
Monomorphize constants before inspecting them
Browse files Browse the repository at this point in the history
(cherry picked from commit c7428d5)
  • Loading branch information
oli-obk authored and cuviper committed Aug 18, 2023
1 parent 5905d9c commit 402cc35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/mir/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/ui/simd/shuffle.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down

0 comments on commit 402cc35

Please sign in to comment.