Skip to content

Commit faf44bc

Browse files
committed
[Rust] Have LowLevelILBlock derive Clone rather than manually implementing it
This is possible now that FunctionMutability and FunctionForm require Copy, and fixes an existing clippy warning about the non-canonical implementation of `clone` on a `Copy` type.
1 parent 5be5915 commit faf44bc

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

rust/src/low_level_il/block.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::basic_block::{BasicBlock, BlockContext};
1919

2020
use super::*;
2121

22-
#[derive(Copy)]
22+
#[derive(Copy, Clone)]
2323
pub struct LowLevelILBlock<'func, M, F>
2424
where
2525
M: FunctionMutability,
@@ -63,18 +63,6 @@ where
6363
}
6464
}
6565

66-
impl<M, F> Clone for LowLevelILBlock<'_, M, F>
67-
where
68-
M: FunctionMutability,
69-
F: FunctionForm,
70-
{
71-
fn clone(&self) -> Self {
72-
LowLevelILBlock {
73-
function: self.function,
74-
}
75-
}
76-
}
77-
7866
pub struct LowLevelILBlockIter<'func, M, F>
7967
where
8068
M: FunctionMutability,

0 commit comments

Comments
 (0)