| 807 | |
| 808 | impl std::hash::Hash for HashedEngineCompileEnv<'_> { |
| 809 | fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) { |
| 810 | // Hash the compiler's state based on its target and configuration. |
| 811 | if let Some(compiler) = self.0.compiler() { |
| 812 | compiler.triple().hash(hasher); |
| 813 | compiler.flags().hash(hasher); |
| 814 | compiler.isa_flags().hash(hasher); |
| 815 | } |
| 816 | |
| 817 | // Hash configuration state read for compilation |
| 818 | let config = self.0.config(); |
| 819 | self.0.tunables().hash(hasher); |
| 820 | self.0.features().hash(hasher); |
| 821 | config.wmemcheck.hash(hasher); |
| 822 | |
| 823 | // Catch accidental bugs of reusing across crate versions. |
| 824 | config.module_version.hash(hasher); |
| 825 | } |
| 826 | } |