Types: add missing semicolon to satisfy clippy::pedantic after merge #25
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/025-types-add-missing-semicolon-to-satisfy-clippy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Types: add missing semicolon to satisfy clippy::pedantic after merge
Along the way:
# trapdiagnostic-expectation section + untrapped ratchetfnas an abstract declaration (close gap 1){ }(close gap 2)Touches 48 files:
docs/actors.md,docs/impl/runtime-testing/T2-diagnostic-traps-and-migration.md,docs/impl/stdlib-floor-gaps.md,src/rust/crates/ck_cktest/src/diag_trap.rs,src/rust/crates/ck_cktest/src/lib.rs,src/rust/crates/ck_docs_linkchecker/src/lib.rsand 42 more.Happy with this. I ran the suite against the branch and it is green,
src/rust/crates/ck_parser/tests/corpus_stdlib.rsincluded.@ -0,0 +227,4 @@}#[test]fn render_lowers_diagnostics_to_actual_traps() {render_lowers_diagnostics_to_actual_trapsreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?@ -141,0 +194,4 @@}pages.push(Page {path,source: String::new(),sourceallocates a fresh buffer per call. If this runs per frame or per token, can the buffer be reused?@ -0,0 +31,4 @@fn stdlib_dir() -> PathBuf {let mut p = PathBuf::from(env!("CARGO_MANIFEST_DIR"));for _ in 0..4 {p = p.parent().expect("ancestor of ck_parser").to_path_buf();The expect message on
pis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?It said what I assumed. Reworded in
src/rust/crates/ck_parser/tests/corpus_stdlib.rsso it names the input that broke it, which is what the bug report will need.Split. The decision in
render_lowers_diagnostics_to_actual_trapsis a pure function now, with its own tests insrc/rust/crates/ck_cktest/src/diag_trap.rs.It runs per token. The buffer behind
sourcelives on the struct insrc/rust/crates/ck_cktest/src/lib.rsnow and is cleared rather than reallocated.# trapdiagnostic-expectation section + untrapped ratchet 00f9e28a19Capture the parser limitations hit building the floor-up stdlib as `# trap`-covered fixtures (assert current behavior; fail loudly when fixed): - bodyless_module_fn.cktest — bodyless module-level `fn` (E0035) - record_literal_in_arg.cktest — record literal in call-arg position (E0050 + E0036), blocking `Panic::raise(E{}, h)` docs/impl/stdlib-floor-gaps.md is the externalized worklist: the two gaps above, the `intrinsic`-body design gap (no diagnostic — Memory.ck fakes it with a stray-ident `{ intrinsic }`), what the merge already un-blocked (match-on-Bool, trait body fields, newtype/type lowering, (N)-suffix retired), and what stays deferred in the corpus until each lands. Both fixtures fully trapped — untrapped-diagnostic ratchet holds at 113.fnas an abstract declaration (close gap 1) 2793c6e21fA module-level `fn` with no `{ … }` body was rejected (E0035), blocking intrinsic/operation signatures that have no CkLang body. A bodyless `fn` is now accepted at module level as an abstract declaration — structurally the signature-only shape a trait method already has. Name resolution already treated the body as optional (`resolve_fn`), so a bodyless `FnDecl` resolves its signature and skips the body. `parse_fn_decl` takes an `allow_bodyless` flag: `true` only at module level; `impl`, `actor`, and `test`/`seed fn` bodies still require a `{ … }` and emit E0035 on a missing one (an implementation / message handler / test must carry a body). - Unit tests: `module_fn_may_be_bodyless` (no E0035) + `impl_method_missing_body_emits_e0035` (E0035 retained for impl). - The gap trap fixture is promoted to a positive regression fixture (`tests/parser/fn/bodyless_module_fn.cktest`); the untrapped-diagnostic ratchet is unchanged (the gap was trapped, contributing 0).{ }(close gap 2) b83b74243aAn empty record literal passed directly as a call argument — `g(Oops { }, 1)`, the `Panic::raise(SomeError { }, hint)` shape — was rejected: the parser read `Oops` as a path, then the `{` closed the argument list early (E0050) with an E0036 cascade. Non-empty literals already parsed in argument position; the empty form was the actual gap, because `at_record_expr_start` required an `Ident :` first field. Fix: a position-scoped `no_record_literal` restriction (cf. Rust's `NO_STRUCT_LITERAL`). The postfix `{`-as-record branch is suppressed only while parsing a control-flow *head* (`if`/`while` condition, `for` iterable, `match` scrutinee) and is cleared again the moment parsing descends into a delimited group — `( … )`, `[ … ]`, an argument list, or a `{ … }` block body — where a `{` after a path is unambiguously a record literal. `at_record_expr_start` also now recognizes the empty `{ }` shape. This additionally corrects the latent `if c { x: 1 } …` case (the head brace is the body, not a record on `c`), aligning the code with the long-standing docstrings that say control-flow heads stay brace-free. - New `record_expr.rs` unit tests: empty record in leading / arg / mid-arglist position, plus non-regression for empty `if`/`while`/`for`/`match` bodies and a record argument inside an `if` head. - The gap trap fixture is promoted to a positive regression fixture (`tests/parser/record/record_literal_in_arg.cktest`); the untrapped-diagnostic ratchet is unchanged (the gap was trapped, contributing 0). The now-empty `tests/parser/gaps/` directory is removed.