Capability: a stage the matrix had no word for, and a diagnostic that named the wrong fact #225
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/225-capability-a-stage-the-matrix-had-no-word-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?
Capability: a stage the matrix had no word for, and a diagnostic that named the wrong fact
Along the way:
Touches 13 files:
src/rust/crates/ck_cktest/src/capability.rs,src/rust/crates/ck_driver/src/compile/mod.rs,src/rust/crates/ck_driver/src/compile/mono.rs,src/rust/crates/ck_driver/src/user_fns.rs,src/rust/crates/ck_driver/tests/capability.rs,src/rust/crates/ck_types/src/diag.rsand 7 more.Mostly there, but the question on
src/rust/crates/ck_cktest/src/capability.rsneeds an answer before this lands.@ -537,0 +571,4 @@/// `lower:` and `codegen:` — the place LC6 stamping actually runs.#[test]fn monomorphize_is_a_peer_of_the_other_failure_forms() {let cell = parse_capability("monomorphize: NoInstantiation\n", 1).unwrap();cellunwraps here. If this is reachable from user input it is a panic in front of a person rather than an error they can read. Is it provably there at this point, or should it carry a??@ -135,0 +184,4 @@variants.iter().map(|v| format!("`{v}`")).collect::<Vec<_>>()collectallocates a fresh buffer per call. If this runs per frame or per token, can the buffer be reused?@ -524,3 +578,3 @@#[test]fn concrete_tag_in_a_value_slot_is_not_e0742() {fn concrete_tag_in_a_value_slot_is_accepted() {concrete_tag_in_a_value_slot_is_acceptedreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?It is reachable. The function in
src/rust/crates/ck_cktest/src/capability.rsreturns a Result now and the caller reports it, so the unwrap oncellis gone.Split. The decision in
concrete_tag_in_a_value_slot_is_acceptedis a pure function now, with its own tests insrc/rust/crates/ck_types/src/param_args.rs.It runs per token. The buffer behind
collectlives on the struct insrc/rust/crates/ck_types/src/diag/values.rsnow and is cleared rather than reallocated.Pushed a fix for both. The second pass on
src/rust/crates/ck_cktest/src/capability.rsis much smaller than the first.That is it for
src/rust/crates/ck_cktest/src/capability.rs. Thanks for the second pass.