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
Spec test spec_ss04_8_unit_elision fails: §4.8 unit elision unimplemented #723
One spec test of the four remains non-compliant: test/spec/spec_ss04_8_unit_elision.w (§4.8 unit elision, unimplemented). The other three pass.
Original report
The native-spec-tests lane had never executed this session (masked behind earlier red lanes). After the batch fixes, 4 of its reds reproduce identically on the PRE-BATCH SEED — long-standing spec non-compliance, not batch regressions:
Per "the spec leads the implementation," each needs its own root-cause; ss13_2 (iterator borrowing) likely narrows further now that #716's fn iter(self: &Self) landed. Separate from: the 4 spec fixtures held red as #714 evidence (mandatory-move rejecting blessed §14 examples) and the 3 in-batch Class-B regressions.
A narrower read on spec_ss07_2_builder_block_return.w, in case it helps root-cause that one of the four.
On v0.15.2.1 (Windows x86_64) the fixture fails 3 of 7, and the split is clean: the three tests that mutate the builder through a method call fail, and the rest pass, including test_assignment_tail_returns_builder.
$ with test spec_ss07_2_builder_block_return.w
panic at …:25:5: assertion failed test: test_unit_call_tail_returns_builder
panic at …:34:5: assertion failed test: test_non_unit_tail_returns_builder
panic at …:44:12: called unwrap on None test: test_non_unit_hashmap_tail_returns_builder
error: 3 of 7 tests failed
A standalone repro shows the same boundary — field assignment survives, method-call mutation is dropped, whether the receiver is the builder itself or a field of it:
type Cfg { port: i32, tags: Vec[i32] }
fn main:
let a: Vec[i32] = with Vec.new() as mut v:
v.push(1)
v.push(2)
print(f"a={a.len()}")
var seed: Vec[i32] = Vec.new()
let b = with seed as mut v:
v.push(7)
print(f"b={b.len()}")
let c = with Cfg { port: 1, tags: Vec.new() } as mut cfg:
cfg.port = 8080
cfg.tags.push(3)
print(f"c.port={c.port} c.tags={c.tags.len()}")
$ with run --debug-alloc builder.w
a=0
b=0
c.port=8080 c.tags=0
debug-alloc: leak count=0
with check accepts it and it exits 0, so in user code the mutation is lost silently rather than reported. I haven't tested main; the fixture's known-issue: #723 directive is unchanged there.
Concrete repro of the class, found writing the #1298 test (installed with v0.15.2.1-g478b26481 and a fresh stage1 from bbb9c5b agree). A str field assigned inside a struct builder is lost on the builder's return; i32 fields survive:
use std.builtins.print_i32
type Changes { n: i32 = 0, last: str = "" }
fn describe(x: i32) -> Changes:
let changes = with Changes { } as mut c:
c.n += 1
c.last = "gt1"
c.n += 1
changes
fn main:
let a = describe(3)
print_i32(a.n) // 2
print(a.last) // "" — expected gt1
Same shape with Vec[i32].new() / Vec[str].new() and push returns an empty vec (spec_ss07_2's red cases). MirLower.lower_with_binding returns OK_COPY of the builder local and then pops the scope, which drops the local — the heap-owning payload is freed under the copy. The #1298 behavior test observes the rule through i32 fields until this is fixed.
spec_ss13_2_iterator_borrowing passes on the D111 stack (str is a value, so the borrowed iteration no longer moves its source); its known-issue directive is removed in PR #2275. The other three tests this issue lists are unchanged.
changed the title [-]4 spec tests fail on the seed too (pre-existing spec debt, surfaced when the lane first ran)[/-][+]Spec test spec_ss04_8_unit_elision fails: §4.8 unit elision unimplemented[/+]on Oct 25, 2026
Triage 2026-10-25, with v0.15.3.0 (main a261b65): one of the four still reproduces. spec_ss07_1_with_type_based_guard_inference and spec_ss07_2_builder_block_return now pass (2 and 7 tests), and spec_ss13_2_iterator_borrowing passed with D111. spec_ss04_8_unit_elision still carries //! known-issue: #723 unit elision unimplemented.
post-release: §4.8 unit elision is a type-system feature; no user program depends on it today.
Activity
Foundation modules: fix copy-view-drop double frees; re-pin masked ph…
Test runner: known-issue directive; disposition the six ruled spec re…
MirLower: branch-created statement temps drop inside their branch (#729…
joshhickson commentedon Sep 17, 2026
A narrower read on
spec_ss07_2_builder_block_return.w, in case it helps root-cause that one of the four.On
v0.15.2.1(Windows x86_64) the fixture fails 3 of 7, and the split is clean: the three tests that mutate the builder through a method call fail, and the rest pass, includingtest_assignment_tail_returns_builder.A standalone repro shows the same boundary — field assignment survives, method-call mutation is dropped, whether the receiver is the builder itself or a field of it:
with checkaccepts it and it exits 0, so in user code the mutation is lost silently rather than reported. I haven't testedmain; the fixture'sknown-issue: #723directive is unchanged there.MirLower: `with expr as mut x:` moves the builder out instead of drop…
ehartford commentedon Sep 22, 2026
Concrete repro of the class, found writing the #1298 test (installed
with v0.15.2.1-g478b26481and a fresh stage1 from bbb9c5b agree). Astrfield assigned inside a struct builder is lost on the builder's return;i32fields survive:Same shape with
Vec[i32].new()/Vec[str].new()andpushreturns an empty vec (spec_ss07_2's red cases).MirLower.lower_with_bindingreturnsOK_COPYof the builder local and then pops the scope, which drops the local — the heap-owning payload is freed under the copy. The #1298 behavior test observes the rule throughi32fields until this is fixed.MirLower: `with expr as mut x:` moves the builder out instead of drop…
ehartford commentedon Oct 8, 2026
spec_ss13_2_iterator_borrowing passes on the D111 stack (str is a value, so the borrowed iteration no longer moves its source); its known-issue directive is removed in PR #2275. The other three tests this issue lists are unchanged.
D111: a str is a value (counted buffers, holds, last use moves) (#2275)
[-]4 spec tests fail on the seed too (pre-existing spec debt, surfaced when the lane first ran)[/-][+]Spec test spec_ss04_8_unit_elision fails: §4.8 unit elision unimplemented[/+]ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): one of the four still reproduces.spec_ss07_1_with_type_based_guard_inferenceandspec_ss07_2_builder_block_returnnow pass (2 and 7 tests), andspec_ss13_2_iterator_borrowingpassed with D111.spec_ss04_8_unit_elisionstill carries//! known-issue: #723 unit elision unimplemented.post-release: §4.8 unit elision is a type-system feature; no user program depends on it today.
Pre-release fixes: std len casts, no host sample, AEAD (#1054), races (…