Skip to content

Commit 94f21bc

Browse files
authored
Enable warnings if coredump is disabled (bytecodealliance#10135)
Continuation of work in bytecodealliance#10131
1 parent 23fc0c1 commit 94f21bc

File tree

6 files changed

+7
-1
lines changed

6 files changed

+7
-1
lines changed

crates/wasmtime/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ pub struct Config {
161161
pub(crate) memory_guaranteed_dense_image_size: u64,
162162
pub(crate) force_memory_init_memfd: bool,
163163
pub(crate) wmemcheck: bool,
164+
#[cfg(feature = "coredump")]
164165
pub(crate) coredump_on_trap: bool,
165166
pub(crate) macos_use_mach_ports: bool,
166167
pub(crate) detect_host_feature: Option<fn(&str) -> Option<bool>>,
@@ -265,6 +266,7 @@ impl Config {
265266
memory_guaranteed_dense_image_size: 16 << 20,
266267
force_memory_init_memfd: false,
267268
wmemcheck: false,
269+
#[cfg(feature = "coredump")]
268270
coredump_on_trap: false,
269271
macos_use_mach_ports: !cfg!(miri),
270272
#[cfg(feature = "std")]

crates/wasmtime/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@
292292
not(feature = "gc-null"),
293293
not(feature = "cranelift"),
294294
not(feature = "pooling-allocator"),
295-
not(feature = "coredump"),
296295
not(feature = "runtime"),
297296
not(feature = "component-model"),
298297
not(feature = "threads"),

crates/wasmtime/src/runtime/externals/global.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ impl Global {
264264
/// Even if the same underlying global definition is added to the
265265
/// `StoreData` multiple times and becomes multiple `wasmtime::Global`s,
266266
/// this hash key will be consistent across all of these globals.
267+
#[cfg(feature = "coredump")]
267268
pub(crate) fn hash_key(&self, store: &StoreOpaque) -> impl core::hash::Hash + Eq + use<> {
268269
store[self.0].definition.as_ptr() as usize
269270
}

crates/wasmtime/src/runtime/instance.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ impl Instance {
605605
/// Returns both exported and non-exported globals.
606606
///
607607
/// Gives access to the full globals space.
608+
#[cfg(feature = "coredump")]
608609
pub(crate) fn all_globals<'a>(
609610
&'a self,
610611
store: &'a mut StoreOpaque,
@@ -625,6 +626,7 @@ impl Instance {
625626
/// Returns both exported and non-exported memories.
626627
///
627628
/// Gives access to the full memories space.
629+
#[cfg(feature = "coredump")]
628630
pub(crate) fn all_memories<'a>(
629631
&'a self,
630632
store: &'a mut StoreOpaque,

crates/wasmtime/src/runtime/memory.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ impl Memory {
659659
/// Even if the same underlying memory definition is added to the
660660
/// `StoreData` multiple times and becomes multiple `wasmtime::Memory`s,
661661
/// this hash key will be consistent across all of these memories.
662+
#[cfg(feature = "coredump")]
662663
pub(crate) fn hash_key(&self, store: &StoreOpaque) -> impl core::hash::Hash + Eq + use<> {
663664
store[self.0].definition.as_ptr() as usize
664665
}

crates/wasmtime/src/runtime/module/registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ impl ModuleRegistry {
8585
}
8686

8787
/// Gets an iterator over all modules in the registry.
88+
#[cfg(feature = "coredump")]
8889
pub fn all_modules(&self) -> impl Iterator<Item = &'_ Module> + '_ {
8990
self.loaded_code
9091
.values()

0 commit comments

Comments
 (0)