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
t27b: move the type-text rules of lower.rs (type_base, close_of_open, type_construct's shape and more) to specs/tri/t27b/type_text.t27 #8229
Port slice of #6198 (t27b written in t27), under #6063 and #5980.
What
cli/t27b/src/lower.rs lowers the t27c AST to t27b's IR. A type reaches it as the source spelling the t27c parser keeps (?*const [4]u8, [T; N], gf16::GF16). Several of the rules that read that spelling ask nothing of the rest of the file, and are hand-written Rust today:
close_of_open: the ] that closes a leading [;
type_base: the element name under ?, &, *, const, a postfix ? and the array and slice forms;
zig_type_name and undeclared_field_type: a struct field type the reference emits as a name Zig cannot resolve;
is_scoped_gf16: m::GF16 as u16;
returns_value: a return type that is a value;
the shape decision of type_construct: the construct a refused type is counted under.
This issue moves them to specs/tri/t27b/type_text.t27.
Plan
The spec has test blocks whose expected values come from the hand-written Rust on master. Trimming follows Rust's str::trim, including the non-ASCII White_Space chars, so the port is exact.
t27c gen-rust writes gen/rust/tri/t27b/type_text.rs, which is mounted with #[path] in lower.rs as tt. The hand bodies are deleted. Glue keeps only the lookups in the file's declarations (type_decls, the declared set) and the strings refusals are built from.
lower.rs loses those hand-written bodies, its hand glue stays within master's check_budget caps, and the net change in hand lines under cli/t27b/ is negative.
The corpus receipts show no file changed its verdict or its t27b asm digest, apart from the new spec itself.
Activity
Merge master 0fca4bd into the type-text port (Closes #8229)
t27b: the type-text rules of lower.rs move to specs/tri/t27b/type_tex…