alexcrichton opened issue #11181:
In light of unsafe code guidelines for Wasmtime and browsing the list of Clippy lints there are a number that we might want to opt-in to. For example:
missing_safety_doc- this would help ensure that# Safetysections are available on allunsafefunctions.multiple_unsafe_ops_per_block- this would help ensure that// SAFETY: ...documentation for anunsafeblock is accurately describing just one unsafe operation, not multiple by accident. This might also help over time where new unsafety couldn't get introduced in a block by accident without explaining why it's valid.undocumented_unsafe_blocks- this would ensure that all unsafe blocks have a comment explaining their rationale.To be clear though I do not believe that it would be helpful to blanket require this for the workspace all at once. Writing lots of trivial
// SAFETYdocumentation that doesn't do anything more than the obvious is not going to be helpful and will otherwise introduce a lot of noise. Nevertheless though I do think there's a world in which we could perhaps migrate a module-at-a-time to enabling these lints (or maybe even function-at-a-time if modules are too coarse-grained). Over time more and more of thewasmtimecrate would be held to a higher standard and eventually the entire crate would use these lints (or some subset).
alexcrichton added the wasmtime:unsafe-code label to Issue #11181.
Last updated: Dec 06 2025 at 06:05 UTC