mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
implement transmute intrinsic
This commit is contained in:
parent
7525a38af5
commit
513e340bd3
@ -1187,7 +1187,7 @@ impl Evaluator<'_> {
|
||||
fn exec_intrinsic(
|
||||
&self,
|
||||
as_str: &str,
|
||||
_arg_bytes: impl Iterator<Item = Vec<u8>>,
|
||||
mut arg_bytes: impl Iterator<Item = Vec<u8>>,
|
||||
generic_args: Substitution,
|
||||
locals: &Locals<'_>,
|
||||
) -> Result<Vec<u8>> {
|
||||
@ -1202,6 +1202,12 @@ impl Evaluator<'_> {
|
||||
None => return Err(MirEvalError::TypeError("size_of arg is unsized")),
|
||||
}
|
||||
}
|
||||
"transmute" => {
|
||||
let Some(arg) = arg_bytes.next() else {
|
||||
return Err(MirEvalError::TypeError("trasmute arg is not provided"));
|
||||
};
|
||||
Ok(arg)
|
||||
}
|
||||
_ => not_supported!("unknown intrinsic {as_str}"),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user