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
Annotated let/var does not materialize a str view (D22: annotation demands what it says) #781
for __line in stdin.lines():
var line: str = __line # error: type mismatch in binding
D22/D27: a binding names what's there, an annotation demands what it says — var line: str = <&str view> establishes an owned demand and should materialize an independent str (clone), like tail-position returns already do. Instead it's a type mismatch, and the working spelling is the explicit __line.clone().
Hit while fixing the -p one-liner template (cli-selfhost-one-liner-tests); the template now uses .clone(). When this lands, the template can go back to the annotated spelling.
Triage 2026-08-31: CLOSE (overcome by events). Fixed by 8d908d9 "explicit owned demand materializes a str view (#781)" — both the annotated-binding shape and the exact stdin.lines() repro run green on the current compiler.
Activity
cli/sema: -p one-liner template owns its line; regex match accepts vi…
sema/mir: explicit owned demand materializes a str view (#781)
ehartford commentedon Aug 31, 2026
Triage 2026-08-31: CLOSE (overcome by events). Fixed by 8d908d9 "explicit owned demand materializes a str view (#781)" — both the annotated-binding shape and the exact stdin.lines() repro run green on the current compiler.
A use inside an f-string keeps a view alive: expr_uses_symbol walks i…