summaryrefslogtreecommitdiff
path: root/rust/src/low_level_il/block.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-04-30 17:38:40 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commitc3fdda9727f5507818e3f55576ad32215a22b0f9 (patch)
treed522025055eb7253c7f2cb94732402aacf2afbfc /rust/src/low_level_il/block.rs
parentc3f344a38ca4b027b4e69b0f82d3184622d6da79 (diff)
[Rust] Remove Architecture trait bound on LLIL related structures
Diffstat (limited to 'rust/src/low_level_il/block.rs')
-rw-r--r--rust/src/low_level_il/block.rs33
1 files changed, 13 insertions, 20 deletions
diff --git a/rust/src/low_level_il/block.rs b/rust/src/low_level_il/block.rs
index ac0be449..519c707e 100644
--- a/rust/src/low_level_il/block.rs
+++ b/rust/src/low_level_il/block.rs
@@ -15,38 +15,35 @@
use std::fmt::Debug;
use std::ops::Range;
-use crate::architecture::Architecture;
use crate::basic_block::{BasicBlock, BlockContext};
use super::*;
#[derive(Copy)]
-pub struct LowLevelILBlock<'func, A, M, F>
+pub struct LowLevelILBlock<'func, M, F>
where
- A: 'func + Architecture,
M: FunctionMutability,
F: FunctionForm,
{
- pub(crate) function: &'func LowLevelILFunction<A, M, F>,
+ pub(crate) function: &'func LowLevelILFunction<M, F>,
}
-impl<'func, A, M, F> BlockContext for LowLevelILBlock<'func, A, M, F>
+impl<'func, M, F> BlockContext for LowLevelILBlock<'func, M, F>
where
- A: 'func + Architecture,
M: FunctionMutability,
F: FunctionForm,
{
- type Instruction = LowLevelILInstruction<'func, A, M, F>;
+ type Instruction = LowLevelILInstruction<'func, M, F>;
type InstructionIndex = LowLevelInstructionIndex;
- type Iter = LowLevelILBlockIter<'func, A, M, F>;
+ type Iter = LowLevelILBlockIter<'func, M, F>;
- fn start(&self, block: &BasicBlock<Self>) -> LowLevelILInstruction<'func, A, M, F> {
+ fn start(&self, block: &BasicBlock<Self>) -> LowLevelILInstruction<'func, M, F> {
self.function
.instruction_from_index(block.start_index())
.unwrap()
}
- fn iter(&self, block: &BasicBlock<Self>) -> LowLevelILBlockIter<'func, A, M, F> {
+ fn iter(&self, block: &BasicBlock<Self>) -> LowLevelILBlockIter<'func, M, F> {
LowLevelILBlockIter {
function: self.function,
range: (block.start_index().0)..(block.end_index().0),
@@ -54,9 +51,8 @@ where
}
}
-impl<'func, A, M, F> Debug for LowLevelILBlock<'func, A, M, F>
+impl<'func, M, F> Debug for LowLevelILBlock<'func, M, F>
where
- A: 'func + Architecture + Debug,
M: FunctionMutability,
F: FunctionForm,
{
@@ -67,9 +63,8 @@ where
}
}
-impl<'func, A, M, F> Clone for LowLevelILBlock<'func, A, M, F>
+impl<'func, M, F> Clone for LowLevelILBlock<'func, M, F>
where
- A: 'func + Architecture,
M: FunctionMutability,
F: FunctionForm,
{
@@ -80,24 +75,22 @@ where
}
}
-pub struct LowLevelILBlockIter<'func, A, M, F>
+pub struct LowLevelILBlockIter<'func, M, F>
where
- A: 'func + Architecture,
M: FunctionMutability,
F: FunctionForm,
{
- function: &'func LowLevelILFunction<A, M, F>,
+ function: &'func LowLevelILFunction<M, F>,
// TODO: Once step_trait is stable we can do Range<InstructionIndex>
range: Range<usize>,
}
-impl<'func, A, M, F> Iterator for LowLevelILBlockIter<'func, A, M, F>
+impl<'func, M, F> Iterator for LowLevelILBlockIter<'func, M, F>
where
- A: 'func + Architecture,
M: FunctionMutability,
F: FunctionForm,
{
- type Item = LowLevelILInstruction<'func, A, M, F>;
+ type Item = LowLevelILInstruction<'func, M, F>;
fn next(&mut self) -> Option<Self::Item> {
self.range