| 3334 | |
| 3335 | impl fmt::Debug for Config { |
| 3336 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 3337 | let mut f = f.debug_struct("Config"); |
| 3338 | |
| 3339 | // Not every flag in WasmFeatures can be enabled as part of creating |
| 3340 | // a Config. This impl gives a complete picture of all WasmFeatures |
| 3341 | // enabled, and doesn't require maintenance by hand (which has become out |
| 3342 | // of date in the past), at the cost of possible confusion for why |
| 3343 | // a flag in this set doesn't have a Config setter. |
| 3344 | let features = self.features(); |
| 3345 | for flag in WasmFeatures::FLAGS.iter() { |
| 3346 | f.field( |
| 3347 | &format!("wasm_{}", flag.name().to_lowercase()), |
| 3348 | &features.contains(*flag.value()), |
| 3349 | ); |
| 3350 | } |
| 3351 | |
| 3352 | f.field("parallel_compilation", &self.parallel_compilation); |
| 3353 | #[cfg(any(feature = "cranelift", feature = "winch"))] |
| 3354 | { |
| 3355 | f.field("compiler_config", &self.compiler_config); |
| 3356 | } |
| 3357 | |
| 3358 | self.tunables.format(&mut f); |
| 3359 | f.finish() |
| 3360 | } |
| 3361 | } |
| 3362 | |
| 3363 | /// Possible Compilation strategies for a wasm module. |