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
{{ message }}
Repository navigation
audit:all reports a leak for a mut fn str receiver reassigned in place (self = self ++ "!"): the caller's place is not an owned local #1822
extend str:
mut fn bang(): self = self ++ "!"
fn main:
var m = "hello"
m.bang()
print(m)
with analyze repro.w audit:all (fix-lang stage1, 2026-09-27):
violation: ownership MIR: fn sym13492 bb0: owned local _1 is still Init at return — no path drops or moves it (a leak)
compiler-analysis-audit: ... violations=1 FAILED
with run --debug-alloc repro.w prints hello! and debug-alloc: leak count=0.
Expected
self in a mut fn is the caller's place (SHARE-PLACE in --dump-abi, D12/D21): the callee never owns it, so leaving it Init at return is the contract, not a leak. The #1488 leak rule treats the in-place receiver local as an owned local. Either the validator's leak rule exempts in-place receiver (value-ref-ABI) parameters, or MIR types that local as a place it does not own — one owner of the fact (D65).
Found building the #1810 matrix; independent of the &str representation (same verdict before and after).
Activity
FnAbi/TypeLayout/Codegen/CCodegen: a shared `&str` is its own `{ptr, …
&str is its own {ptr,len} view (ABI v8): returned string slices, stag…