Skip to content

Commit da92e81

Browse files
committed
remove const_struct
1 parent 1d5839f commit da92e81

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_codegen_ssa/src/mir/constant.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
6666
constant: &mir::ConstOperand<'tcx>,
6767
) -> (Bx::Value, Ty<'tcx>) {
6868
let ty = self.monomorphize(constant.ty());
69-
let ty_is_simd = ty.is_simd();
7069
// FIXME: ideally we'd assert that this is a SIMD type, but simd_shuffle
7170
// in its current form relies on a regular array being passed as an
7271
// immediate argument. This hack can be removed once that is fixed.
73-
let field_ty = if ty_is_simd {
72+
let field_ty = if ty.is_simd() {
7473
ty.simd_size_and_type(bx.tcx()).1
7574
} else {
7675
ty.builtin_index().unwrap()
@@ -107,7 +106,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
107106
}
108107
})
109108
.collect();
110-
if ty_is_simd { bx.const_vector(&values) } else { bx.const_struct(&values, false) }
109+
bx.const_vector(&values)
111110
})
112111
.unwrap_or_else(|| {
113112
bx.tcx().dcx().emit_err(errors::ShuffleIndicesEvaluation { span: constant.span });

0 commit comments

Comments
 (0)