chore(lints): temporarily disable dead_code for the slices 1–8 root pass #62
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/062-chore-lints-temporarily-disable-dead-code-for"
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?
chore(lints): temporarily disable dead_code for the slices 1–8 root pass
Along the way:
Tuplegrammar and the general= exprfn bodyTouches 50 files:
docs/impl/03-parser.md,src/rust/Cargo.toml,src/rust/crates/ck_codegen/src/call.rs,src/rust/crates/ck_codegen/src/format.rs,src/rust/crates/ck_codegen/src/lib.rs,src/rust/crates/ck_codegen/src/resolution.rsand 44 more.Happy with this. I ran the suite against the branch and it is green,
src/rust/crates/ck_syntax/src/type_decls.rsincluded.@ -173,0 +286,4 @@}/// The value token text (`IntLit` / `TrueKw` / `FalseKw`) of a `LeafAttr`.fn leaf_attr_value_token<'a>(attr: &SyntaxNode, src: &'a str) -> Option<&'a str> {leaf_attr_value_tokenreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?Split. The decision in
leaf_attr_value_tokenis a pure function now, with its own tests insrc/rust/crates/ck_syntax/src/type_decls.rs.The authored Floor.ck / Alloc.ck cannot resolve until the parser reads the four surface forms the root pass introduces. This is purely additive parser + CST-accessor work; no existing production changes, all 485 parser tests plus the corpus stay green (Floor.ck is not yet injected). 1a. Attr-block newtype — `newtype i8 { size: 8, signed: true, float: false }`. A scalar leaf's machine-attribute block (metadata, like an operator's config block; NOT a field record — a leaf is opaque, no `.value`). New LeafAttrs/LeafAttr node kinds; NewtypeDecl accessors read size/signed/ float and the attr-name set (for the closed-leaf-set arch-test). 1b. Alias newtype — `newtype Handle = usize`. NewtypeDecl::alias_target. 1c. Enumerated `where` — `where T is A or B or C` folds the bound into a UnionType via parse_type_expr; `and` joins predicates (`where From is … and To is …`). 1d. Opcode-in-body — `= intrinsic.<opcode>(args)`: a `.`-member on the `intrinsic` keyword capturing the opcode ident (emitted verbatim, no name→opcode table) plus an arg list. FnDecl::intrinsic_opcode_span / intrinsic_arg_list accessors. New diagnostics E0124–E0129 (opcode/arg-list/leaf-attr malformations).Additive, inert foundation for the root-live slice's Ty::Primitive collapse: a well-known-scalar-name -> TypeId registry + a TypeId -> {size,signed,float} LeafRepr map on the interner (ck_hir), plus the resolve hook that registers a leaf newtype from Floor.ck's {size,signed,float} attr block. Inert until Floor.ck is injected (no leaf newtypes exist yet); build green, tests unaffected. Checkpoint on wip_v2 so the collapse builds directly onto it. Part of the root-live slice (slices 1-3 merged); dead_code=deny temporarily off (owner 2026-07-11), re-enabled + swept after slice 8.Tuplegrammar and the general= exprfn body 7e24f27951Two settled grammar forms the authored design files (`Types.ck`, `Alloc.ck`) need, landed end-to-end (lex → parse → CST → resolve → type → lowering-boundary) as additive surface — no leaf deleted, `Ty::Primitive` / the intrinsic registry / `binop_lower` untouched, `Floor.ck` / `Alloc.ck` not injected. FORM 1 — the structural `Tuple` `(| … |)` (locked token pair, owner 2026-07-07): - Lexer: the `(|` / `|)` token pair (`LParenPipe` / `PipeRParen`, maximal munch). - Parser + CST: the tuple TYPE in type position and the tuple LITERAL in expr position (positional + labeled), plus positional component access `t.0` (`MemberExpr` now accepts an `IntLit` selector). New CST accessors live in a cohesive `ck_syntax/src/tuple.rs` (the `ast/actors.rs` split precedent), not scattered free functions. E0130 / E0131 for an unclosed `(| … |)`. - Type system: a structural `Ty::Tuple(Vec<Ty>)` kind + `Ty::tuple` constructor (absorbing-`Unknown`, mirroring `nominal`/`func`), lift, render, arena-size (a product — Σ of components, vs a union's max), subst, and synth. Identity is by ordered component types, so labels are cosmetic and not carried. `assignable` grows one structural case: same arity, component-wise assignable. - Lowering: STOP — a tuple type-checks to `Ty::Tuple` but lowering it by the generic value-type law needs the name-free positional frame variant, and returning one by value (`alloc`'s `(| handle, arena |)`) needs the multi-word / multi-value ABI. Both are the values / function-call multi-value ABI slice. Landed as an honest `LowerError::TupleUnsupported` (the `SpawnUnsupported` precedent), never a silently-dropped node — no fake positional symbols minted. FORM 2 — the general expression-bodied fn `fn f(params) -> R (where …)? = expr`: - Parser: the `= …` body dispatch is now a cohesive `FnBodyForm` strategy (block / `= intrinsic` / `= expr` / missing), so new body forms extend the enum rather than the dispatch chain. A `= expr` wraps in an `ExprBody` node. The retired "there is no `fn f() = expr`" E0119 hard-reject is gone. - CST: `FnDecl::body()` returns the `= expr` inner expression (a `+ expr_body()` accessor), so the resolver / lowerer / type-checker — which all consume `body()` and check the body root against `R` — treat `= expr` exactly like a block's trailing expression. The expr is thus type-checked against `R` and is the fn body with no new resolve/type/lower code; `signature_shape` excludes it. Gates (from src/rust): fmt --check clean; clippy --all-targets -D warnings = 0; build clean; test = 1267 pass / 0 fail (+15, baseline 1252 not regressed); architecture R1–R4 green (R3/R4 caps unchanged — `syntax_kind.rs` docs trimmed to fit, the tuple accessors split to `tuple.rs`). New tests: parser (positional + labeled tuple type & literal, component access, `= expr` incl. a where-clause case, the `body()` linchpin, round-trip); type system (tuple lift positional + labeled, component-wise assignability, absorbing-`Unknown` ctor, display).Make `Floor.ck` the live floor unit (coexisting with Memory/Sys) and rewire the intrinsic seam off the SOURCE-NAMED opcode (`= intrinsic.<opcode>`), not the fn name. - Corpus: add `tests/corpus/stdlib/Floor.{ck,ckh}` — the closed floor's public surface (scalar leaves + usize/Region/Handle/TickHandle in the header) and its verbatim `intrinsic.<op>` bodies in the impl. `fn tick` omitted (pending Function<Ret>, actors slice). Compiles clean; floor_isa pin unchanged (the opcode-form bodies are not scraped as bare `= intrinsic`). - Membership: `collect_unknown_intrinsics` recognizes a `mod Floor` fn whose body carries an opcode (via `FnDecl::intrinsic_opcode_span`) as a registered floor emission — the mechanical closed set, no per-name table. Memory/Sys bare-`= intrinsic` entries keep the name-keyed registry (coexist at A1). - Targets: `build_intrinsic_targets` records the BODY OPCODE as the lowering target (fn name fallback for the coexisting bare compounds). - Emitter: new `ck_codegen::format` — a format-driven strategy (Binary / Unary / IntCompare / FloatCompare / Convert) selected from the opcode; `icmp_<cc>`/ `fcmp_<cc>` split into opcode + condcode. `is_machine_op`/`syscall_spec` re-keyed off the opcode (module-agnostic), old (module,op) arms retained. - Test: `floor_arith` corpus app + `floor_arith_run` — a freestanding `-> Int` main calls `Floor::iadd`/`imul`/`isub`/`ineg` on `i64` operands and exits 42, exercising the new emitter end-to-end. Registered in `RUNTIME_TESTED`. Gates: fmt/clippy/build clean; arch R1–R4 green; `cargo test --workspace` exits 0.