提交 6444f24a 编写于 作者: S Scott McMurray

Use cranelift's `Type::int` instead of doing the match myself

<https://docs.rs/cranelift-codegen/0.74.0/cranelift_codegen/ir/types/struct.Type.html#method.int>
上级 3d2869c6
......@@ -1118,14 +1118,7 @@ fn swap(bcx: &mut FunctionBuilder<'_>, v: Value) -> Value {
raw_eq, <T>(v lhs_ref, v rhs_ref) {
fn type_by_size(size: Size) -> Option<Type> {
Some(match size.bits() {
8 => types::I8,
16 => types::I16,
32 => types::I32,
64 => types::I64,
128 => types::I128,
_ => return None,
})
Type::int(size.bits().try_into().ok()?)
}
let size = fx.layout_of(T).layout.size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册