feat(t27b): array literals by address, empty slice returns, unused tuple constants - #6580
Merged
Merged
Conversation
…ylit # Conflicts: # cli/t27b/src/lower.rs
Contributor
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6550
Refs #6063
What
const xs = &[_]T{ ... }(the reference's&.{ ... }) is lowered when every use isxs.lenor an argument where the callee declares[]const E, with one E for all uses. It becomes an[N]Ebuilt once. Indexing such a local is still refused, because its elements are comptime values in the reference.return [];andreturn []T{};in a fn returning a slice give an empty slice. A non-empty literal returned as a slice is still refused, because it points at a constant in the reference.cli/t27b/src/lower/arraylit.rs, with three hooks inlower.rs.specs/tri/t27b/conformance/array_literal.t27passest27c test-report(6 pass) and t27b (6 pass).Owner exception
Allowed by the owner 2026-10-05; debt to be replaced via #6198.
The local only-t27 hook (#6511) read an uncommitted line in
tools/policy/foreign-exceptions.txtnamingcli/t27b/src/lower.rs,cli/t27b/src/lower/arraylit.rsandcli/t27b/tests/arraylit.rs. That line is not in this PR. CI'sown-languagecheck honours theowner-approved-foreignlabel.Ledger bless (Q53)
docs/reports/t27b_expectations.jsonis re-blessed in this PR. It also absorbs the master findings of lab run 35f0e71.corpus --blockers) swapped in for the 7 specs it moves, plus the new conformance spec. With that run,tri t27b ratchetis green.queen-report.t27,catalog.t27andgen_linear_regression.t27: blocked to pass (this PR);check_duplicate_declarations.t27: blocked to pass_vacuous (this PR);gf_competitive.t27andselection_sort.t27: blocked to pass (feat(t27b): x.len() and len(x) as the .len field #6571, found by the master run).specs/benchmarks/kernel_{collatz,f64loop,fib,matmul,sieve,ternary}.t27(master run);array_literal.t27(this PR).gen_cross_entropynow blocks onExprCall(@log);transport.t27now blocks onExprArrayLiteral(repeat);smoke_m1.t27now blocks onExprArrayLiteral.Files
specs/tri/t27b/conformance/array_literal.t27docs/reports/t27b_expectations.jsontri t27b ratchet --bless)cli/t27b/src/lower.rs(three hooks,mod arraylit;)cli/t27b/src/lower/arraylit.rscli/t27b/tests/arraylit.rsdocs/now/2026-10-05-t27b-addr-array-literal.mdTests
cargo test -p t27b: all green.tests/arraylit.rs, every source was run undert27c test-reportfirst.Corpus (
t27b corpus specs --blockers --reference <t27c> --reference-cache, jobs 8, after merging master eb5358b)The new passes are
queen-report,catalog,check_duplicate_declarations(vacuous),gen_linear_regressionandarray_literal.t27. Two files that the reference does not pass now get further in t27b, so they are not counted:gen_mse: both t27b and the reference fail.verify_multitarget: t27b fails. The reference refuses Zig's signed%on an untyped local; that is a separate follow-up.🤖 Generated with Claude Code