summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/low_level_il/expression.rs16
-rw-r--r--rust/src/low_level_il/function.rs4
-rw-r--r--rust/src/low_level_il/instruction.rs1
3 files changed, 19 insertions, 2 deletions
diff --git a/rust/src/low_level_il/expression.rs b/rust/src/low_level_il/expression.rs
index 8df8dfe0..81c4e57d 100644
--- a/rust/src/low_level_il/expression.rs
+++ b/rust/src/low_level_il/expression.rs
@@ -59,6 +59,7 @@ where
T: FnMut(&LowLevelILExpression<'func, M, F, ValueExpr>) -> VisitorAction;
}
+#[derive(Copy)]
pub struct LowLevelILExpression<'func, M, F, R>
where
M: FunctionMutability,
@@ -72,6 +73,21 @@ where
pub(crate) _ty: PhantomData<R>,
}
+impl<M, F, R> Clone for LowLevelILExpression<'_, M, F, R>
+where
+ M: FunctionMutability,
+ F: FunctionForm,
+ R: ExpressionResultType,
+{
+ fn clone(&self) -> Self {
+ Self {
+ function: self.function,
+ index: self.index,
+ _ty: PhantomData,
+ }
+ }
+}
+
impl<'func, M, F, R> LowLevelILExpression<'func, M, F, R>
where
M: FunctionMutability,
diff --git a/rust/src/low_level_il/function.rs b/rust/src/low_level_il/function.rs
index 495aae79..d46350dc 100644
--- a/rust/src/low_level_il/function.rs
+++ b/rust/src/low_level_il/function.rs
@@ -31,7 +31,7 @@ pub struct Mutable;
#[derive(Copy, Clone, Debug)]
pub struct Finalized;
-pub trait FunctionMutability: 'static + Debug {}
+pub trait FunctionMutability: 'static + Debug + Copy {}
impl FunctionMutability for Mutable {}
impl FunctionMutability for Finalized {}
@@ -40,7 +40,7 @@ pub struct SSA;
#[derive(Copy, Clone, Debug)]
pub struct NonSSA;
-pub trait FunctionForm: 'static + Debug {}
+pub trait FunctionForm: 'static + Debug + Copy {}
impl FunctionForm for SSA {}
impl FunctionForm for NonSSA {}
diff --git a/rust/src/low_level_il/instruction.rs b/rust/src/low_level_il/instruction.rs
index ef546412..df9d1839 100644
--- a/rust/src/low_level_il/instruction.rs
+++ b/rust/src/low_level_il/instruction.rs
@@ -65,6 +65,7 @@ where
T: FnMut(&LowLevelILExpression<'func, M, F, ValueExpr>) -> VisitorAction;
}
+#[derive(Copy, Clone)]
pub struct LowLevelILInstruction<'func, M, F>
where
M: FunctionMutability,