Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/eval/shim/simd.rs')
-rw-r--r--crates/hir-ty/src/mir/eval/shim/simd.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir-ty/src/mir/eval/shim/simd.rs b/crates/hir-ty/src/mir/eval/shim/simd.rs
index e229a4ab31..984648cfec 100644
--- a/crates/hir-ty/src/mir/eval/shim/simd.rs
+++ b/crates/hir-ty/src/mir/eval/shim/simd.rs
@@ -2,8 +2,8 @@
use std::cmp::Ordering;
-use crate::consteval::try_const_usize;
use crate::TyKind;
+use crate::consteval::try_const_usize;
use super::*;
@@ -31,8 +31,8 @@ impl Evaluator<'_> {
Some(len) => len,
_ => {
if let AdtId::StructId(id) = id.0 {
- let struct_data = self.db.struct_data(id);
- let fields = struct_data.variant_data.fields();
+ let struct_data = self.db.variant_fields(id.into());
+ let fields = struct_data.fields();
let Some((first_field, _)) = fields.iter().next() else {
not_supported!("simd type with no field");
};
@@ -127,7 +127,7 @@ impl Evaluator<'_> {
Ordering::Greater => ["ge", "gt", "ne"].contains(&name),
};
let result = if result { 255 } else { 0 };
- destination_bytes.extend(std::iter::repeat(result).take(dest_size));
+ destination_bytes.extend(std::iter::repeat_n(result, dest_size));
}
destination.write_from_bytes(self, &destination_bytes)
@@ -164,7 +164,7 @@ impl Evaluator<'_> {
None => {
return Err(MirEvalError::InternalError(
"simd type with unevaluatable len param".into(),
- ))
+ ));
}
};
let (left_len, _) = self.detect_simd_ty(&left.ty)?;
@@ -179,7 +179,7 @@ impl Evaluator<'_> {
None => {
return Err(MirEvalError::InternalError(
"out of bound access in simd shuffle".into(),
- ))
+ ));
}
};
result.extend(val);