Skip to content

Commit

Permalink
Enable warnings if coredump is disabled (#10135)
Browse files Browse the repository at this point in the history
Continuation of work in #10131
  • Loading branch information
alexcrichton authored Jan 28, 2025
1 parent 23fc0c1 commit 94f21bc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/wasmtime/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ pub struct Config {
pub(crate) memory_guaranteed_dense_image_size: u64,
pub(crate) force_memory_init_memfd: bool,
pub(crate) wmemcheck: bool,
#[cfg(feature = "coredump")]
pub(crate) coredump_on_trap: bool,
pub(crate) macos_use_mach_ports: bool,
pub(crate) detect_host_feature: Option<fn(&str) -> Option<bool>>,
Expand Down Expand Up @@ -265,6 +266,7 @@ impl Config {
memory_guaranteed_dense_image_size: 16 << 20,
force_memory_init_memfd: false,
wmemcheck: false,
#[cfg(feature = "coredump")]
coredump_on_trap: false,
macos_use_mach_ports: !cfg!(miri),
#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion crates/wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@
not(feature = "gc-null"),
not(feature = "cranelift"),
not(feature = "pooling-allocator"),
not(feature = "coredump"),
not(feature = "runtime"),
not(feature = "component-model"),
not(feature = "threads"),
Expand Down
1 change: 1 addition & 0 deletions crates/wasmtime/src/runtime/externals/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ impl Global {
/// Even if the same underlying global definition is added to the
/// `StoreData` multiple times and becomes multiple `wasmtime::Global`s,
/// this hash key will be consistent across all of these globals.
#[cfg(feature = "coredump")]
pub(crate) fn hash_key(&self, store: &StoreOpaque) -> impl core::hash::Hash + Eq + use<> {
store[self.0].definition.as_ptr() as usize
}
Expand Down
2 changes: 2 additions & 0 deletions crates/wasmtime/src/runtime/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ impl Instance {
/// Returns both exported and non-exported globals.
///
/// Gives access to the full globals space.
#[cfg(feature = "coredump")]
pub(crate) fn all_globals<'a>(
&'a self,
store: &'a mut StoreOpaque,
Expand All @@ -625,6 +626,7 @@ impl Instance {
/// Returns both exported and non-exported memories.
///
/// Gives access to the full memories space.
#[cfg(feature = "coredump")]
pub(crate) fn all_memories<'a>(
&'a self,
store: &'a mut StoreOpaque,
Expand Down
1 change: 1 addition & 0 deletions crates/wasmtime/src/runtime/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ impl Memory {
/// Even if the same underlying memory definition is added to the
/// `StoreData` multiple times and becomes multiple `wasmtime::Memory`s,
/// this hash key will be consistent across all of these memories.
#[cfg(feature = "coredump")]
pub(crate) fn hash_key(&self, store: &StoreOpaque) -> impl core::hash::Hash + Eq + use<> {
store[self.0].definition.as_ptr() as usize
}
Expand Down
1 change: 1 addition & 0 deletions crates/wasmtime/src/runtime/module/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ impl ModuleRegistry {
}

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

0 comments on commit 94f21bc

Please sign in to comment.