Skip to content

Commit 513e340

Browse files
committed
implement transmute intrinsic
1 parent 7525a38 commit 513e340

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/hir-ty/src/mir/eval.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ impl Evaluator<'_> {
11871187
fn exec_intrinsic(
11881188
&self,
11891189
as_str: &str,
1190-
_arg_bytes: impl Iterator<Item = Vec<u8>>,
1190+
mut arg_bytes: impl Iterator<Item = Vec<u8>>,
11911191
generic_args: Substitution,
11921192
locals: &Locals<'_>,
11931193
) -> Result<Vec<u8>> {
@@ -1202,6 +1202,12 @@ impl Evaluator<'_> {
12021202
None => return Err(MirEvalError::TypeError("size_of arg is unsized")),
12031203
}
12041204
}
1205+
"transmute" => {
1206+
let Some(arg) = arg_bytes.next() else {
1207+
return Err(MirEvalError::TypeError("trasmute arg is not provided"));
1208+
};
1209+
Ok(arg)
1210+
}
12051211
_ => not_supported!("unknown intrinsic {as_str}"),
12061212
}
12071213
}

0 commit comments

Comments
 (0)