Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/compiler-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ bitflags = { workspace = true }
itertools = { workspace = true }
malachite-bigint = { workspace = true }
num-complex = { workspace = true }
num_enum = { workspace = true }

lz4_flex = "0.12"

Expand Down
6 changes: 3 additions & 3 deletions crates/compiler-core/src/bytecode/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ impl<T: OpArgType> Arg<T> {

#[inline]
pub fn new(arg: T) -> (Self, OpArg) {
(Self(PhantomData), OpArg(arg.to_op_arg()))
(Self(PhantomData), OpArg(arg.into()))
}

#[inline]
Expand All @@ -1267,15 +1267,15 @@ impl<T: OpArgType> Arg<T> {

#[inline(always)]
pub fn try_get(self, arg: OpArg) -> Result<T, MarshalError> {
T::from_op_arg(arg.0)
T::try_from(arg.0).map_err(|_| MarshalError::InvalidBytecode)
}

/// # Safety
/// T::from_op_arg(self) must succeed
#[inline(always)]
pub unsafe fn get_unchecked(self, arg: OpArg) -> T {
// SAFETY: requirements forwarded from caller
unsafe { T::from_op_arg(arg.0).unwrap_unchecked() }
unsafe { T::try_from(arg.0).unwrap_unchecked() }
}
}

Expand Down
Loading
Loading