diff --git a/cranelift/codegen/src/machinst/vcode.rs b/cranelift/codegen/src/machinst/vcode.rs index 1ca1b25ce3..c57f018e35 100644 --- a/cranelift/codegen/src/machinst/vcode.rs +++ b/cranelift/codegen/src/machinst/vcode.rs @@ -876,7 +876,7 @@ impl VCodeConstantData { #[cfg(test)] mod test { use super::*; - use std::mem::{size_of, size_of_val}; + use std::mem::size_of; #[test] fn size_of_constant_structs() { @@ -888,11 +888,8 @@ mod test { size_of::>(), 24 ); - assert_eq!(size_of::>(), 48); - assert_eq!(size_of::>(), 48); - assert_eq!(size_of::(), 120); - assert_eq!(size_of_val(&VCodeConstants::with_capacity(0)), 120); - // TODO This structure could use some significant memory-size optimization. The use of - // HashMap to deduplicate both pool and well-known constants is clearly an issue. + // TODO The VCodeConstants structure's memory size could be further optimized. + // With certain versions of Rust, each `HashMap` in `VCodeConstants` occupied at + // least 48 bytes, making an empty `VCodeConstants` cost 120 bytes. } }