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
self-host P3 slice 5: L3 and L4 as t27c runs them, and as the constitution states them under strict_laws (E_LAW) #8103
Part of #5980 (phase P3: "the semantic passes t27c runs before codegen (name resolution, type inference, L3/L4 checks)"). This is the fifth and last P3 slice: L3 and L4.
Before codegen, t27c checks L3 (ASCII source) only in its lexer, which refuses a non-ASCII identifier. It does not check L4 (a test, an invariant or a bench) at all. t27c test-report counts untested specs, but it generates them. The constitution says L3 covers comments too and that L4 is enforced by the parser (see #8101).
This slice
By default the core does what t27c does: a non-ASCII name is E_LEX (since P1), and it takes a non-ASCII comment and an untested module, byte-identical with gen-c.
With strict_laws set, compile also refuses with the new code E_LAW (18):
any byte past ASCII, a comment's too (L3);
a module with no test, invariant or bench (L4).
A gate can then enforce the laws without the Rust compiler. The core's own source passes both.
Core tests for both modes; t27core_ddc.t27 restates strict_laws and is repinned.
The switch is off by default because about 497 of the 1703 specs carry non-ASCII comments and about 134 have no test, invariant or bench, as #8101 records. The core's own tests also compile untested snippets.
Activity
t27core: L3 and L4 as t27c runs them, and under strict_laws as the co…