Result: done Files: crates/nikaia-std/src/tools/emit_core_types.nika crates/nikaia-std/src/tools/lowered/emit_core_types.rs tests/compiler/tests/a_function_type_with_two_views.nika tests/compiler/tests/a_function_type_with_two_views.stdout Commit: emit: a function type that may pause, with two views in and a view out, names one lifetime Body: The #703 rule (two lent parameters or more and a view result name one for<'call>) now also covers code that may pause where it is run: impl for<'call> AsyncFn(&'call str, &'call str) -> &'call str; before, the elided impl AsyncFn(&str, &str) -> &str reached rustc as Missing lifetime specifier. Under that rule the result is also read as a slice where it is a list (#1016), which makes the sync list form (fn(ref Vec[i64], ref Vec[i64]) -> ref Vec[i64] sync) run too: it used to fail with Expected longer to return &Vec<i64>, but it returns &[i64]. The kept form of pausing code (a struct field, row d) keeps its old type: writing BoxedIn<'call, &'call str> there leaves the struct’s 'a unused, because views_the_call_s in views.nika (outside this brief) still counts only sync code as handing back the call’s own view. With that change alone, a struct with such a field that compiles today fails with Lifetime parameter 'a is never used. Fixes: #1048 Tests: before the fix: a and b fail with rustc Missing lifetime specifier, c prints 3, d (struct field f: fn(ref String, ref String) -> ref String set to longer, called as h.f(s, s)) fails with rustc Lifetime may not live long enough (a different error, and the fix lies outside the brief’s files, so it is not part of this fix and not in the test). After the fix: a 3, b 3, c 3, d unchanged, a recursive apply prints 3, a struct with a pausing two-view field it never calls still prints 1. New test a_function_type_with_two_views (rows a, b, c, plus a sync list row) fails on the unfixed compiler (old binary: 2x Missing lifetime specifier, &Vec vs &[i64]) and passes on the fixed one; nikaia test --both-settings --project tests/compiler: 466 passed, 0 failed (includes every function_type, code_param and lambda test); lower-std fixpoint clean (only lowered/emit_core_types.rs is mine); clippy -p nikaia-std –features compiler on 1.97 and 1.99.1, fmt, pre-push-check green Gate: green Deviation: the kept and boxed-future forms of the brief’s fix (:206-216) were not built: their type alone breaks a struct that compiles today (above), and the matching struct-lifetime change belongs in views.nika, which the brief keeps out of scope Found: #1048 row d: a struct field holding pausing code with two views in and a view out fails in rustc (Lifetime may not live long enough): the field is written Kept<dyn for<'call> Fn(&'call str, &'call str) -> BoxedIn<'call, &'a str>> in Holder<'a>. Fix: in emit_core_types.nika’s kept branch, write the outcome with 'call (BoxedIn<'call, &'call str>), and also drop the !code.is_sync early return in views_the_call_s (views.nika:421) so that holds_view no longer gives the struct an 'a. Probe: fn longer(a: ref String, b: ref String) -> ref String {..} struct Holder { f: fn(ref String, ref String) -> ref String } let h = Holder { f: longer } println(f"{h.f("abcd", "abcd").len()}") Needs: crates/nikaia/src/comptime_run.rs:648 (another agent’s uncommitted BT2 change) fails clippy (unnecessary use of to_string), so the workspace-wide clippy is red until that agent fixes it; row d needs a brief that may touch views.nika Changelog: A function type that may pause, with two views in and a view out, now gets one lifetime over all of them where it is run, so it no longer reaches rustc as Missing lifetime specifier (#1048). Owner: none Disk freed: 0.4 GB (the 1.99.1 clippy target); project-tests cache 3.4G, disk 7.9G free; new entries over 100 MB: run-bundle/3f8b93b88f7f213d 347 MB, build-time-parsers/768d2772d43bb4cc 1115 MB Rs2nika: none Pushed: local c24d9335980b773c0f65f90452715bfb417a6da5

This site is open source. Improve this page.