You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dpc should be credited with finding semgrep not me :)
Require any non-lock()ing unwrap() to be accompanied by a // safety: comment.
Could disallow any non-lock()ing unwraps altogether and use expect. Not sure how you could whitelist unit tests though, not doing so might be annoying. (In rust-bitcoin we have an (unwritten) no-unwrap outside of unit tests policy.
Recent bugs and discussions highlighted that we may want to enforce some stricter (automated) code checks.
In particular, we may want to introduce
semgrep
to:lock()
ingunwrap()
to be accompanied by a// safety:
comment.SystemTime::now
/Instant::now
/Instant::elapsed_since
to maintain WASM compatibility.Similar approaches are currently applied by other projects in the
rust-bitcoin
ecosystem, related usages are for example:semgrep
rust-bitcoin/rust-bech32#153(cc @tcharding)
The text was updated successfully, but these errors were encountered: