aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/imm.rs
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-12-07 21:58:29 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-12-07 21:58:29 +0100
commit5e6df9a25be0523256abd45483603e334289aed3 (patch)
tree6703536819e0cc4078e42ca75bc64842ab9cdf2b /src/imm.rs
parent5c18f9267329e8eded611a830458ec07115e5670 (diff)
downloadjuicebox-asm-5e6df9a25be0523256abd45483603e334289aed3.tar.gz
juicebox-asm-5e6df9a25be0523256abd45483603e334289aed3.zip
clippy: fix some clippy lints
Diffstat (limited to 'src/imm.rs')
-rw-r--r--src/imm.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/imm.rs b/src/imm.rs
index 85b2cbc..ee51ae5 100644
--- a/src/imm.rs
+++ b/src/imm.rs
@@ -46,5 +46,18 @@ impl_imm!(
);
impl_imm!(
/// Type representing a 64 bit immediate.
- Imm64, 8, from: { u64, i64, u32, i32, u16, i16, u8, i8 }
+ Imm64, 8, from: { u64, i64, u32, i32, u16, i16, u8, i8, usize, isize }
);
+
+#[cfg(test)]
+mod test {
+ use super::*;
+ use std::mem::size_of;
+
+ #[test]
+ fn test_usize_isize() {
+ // Imm64 should not implementd from usize/isize if this fails.
+ assert_eq!(size_of::<usize>(), size_of::<Imm64>());
+ assert_eq!(size_of::<isize>(), size_of::<Imm64>());
+ }
+} \ No newline at end of file