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
Sema: an owned str from ?? / .unwrap_or is not auto-borrowed into a &str parameter ("cannot produce &str"); a call result is #1974
Found while porting tools/debug_drop.w off the internal with_fs_* externs (#1865).
Spec: §3.8 (a &T parameter auto-references its argument: peek(x) when peek takes &T); D22 (Option, Result, ?? and eliminators are transparent to view origins — they do not change what the eliminated value is).
error: ?? expression of type str cannot produce &str
peek(read_file("x").unwrap_or(""))
error: Result.unwrap_or expression of type str cannot produce &str
Expected: all four are an owned str temporary borrowed for the call, as the first two are. The parameter's expected &str appears to be pushed into the eliminator's arms (asking the Result[str, IoError] payload to be a &str) instead of auto-referencing the eliminator's owned result.
Workaround used: bind first: let source = read_file(p) ?? "" then peek(source) (tools/debug_drop.w on branch wave-build). The fix removes it.
Fixed on main in c884c1c (stack #2001 → #2010, seed-driven battery GREEN on b932ef6, tree identical to main). Fixture coverage is in the stack's commits.
Activity
Sema: an owned `??`/unwrap_or result meets a `&T` parameter by auto-r…
Sema: one arity check for every call path (#1973); owned ?? / unwrap_…
ehartford commentedon Oct 3, 2026
Fixed on main in c884c1c (stack #2001 → #2010, seed-driven battery GREEN on b932ef6, tree identical to main). Fixture coverage is in the stack's commits.