Repository navigation
emit_rust: a generic fn stored as a function value forwards its Clone bound (native broker 2A, rule 4) - #13160
Merged
Merged
Conversation
… bound (WIP, mirrors not regenerated) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…instantiated at the literal Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…esult position; join arrow-typed arguments by position Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ding (fixed point verified at b30646e) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 4, 2026
…executor --regen-round-cost; fixed point at round 2) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 4, 2026
… mirror regenerated) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…egenerated next) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbai-bot Bot
pushed a commit
that referenced
this pull request
Oct 4, 2026
…er; mirrors regenerated next
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native broker 2A, rule 4: a generic fn stored as a function value forwards its Clone bound
Part of the native-broker program (owner gentle-dove-36), class A. Rule 1 landed as #13144. Rule 2 (Set-element
Ord) is gunbc#13078's. Rule 3 (leaf-keyed declaration index) is lane 2K's. This PR is rule 4 only; I checked that #13078 does not cover it (its function-value change is about optional unwrapping of lambda arguments).The defect
std.key_relation:Storing
key_relation_global_scope_ofin the arrow field instantiates it at the wrapper'sSubject, exactly as a call would. The callee emits<Subject: Clone>; the wrapper emitted<Relation: 'static, Subject: 'static, Key: 'static>, so rustc refuses atRc::new(key_relation_global_scope_of)(E0277, twice,std_key_relation.rs:106). The existing forwarding derivation only looked at calls.Where the instantiation is read from
A call has arguments to join on. A function value has none, and two places that look like they carry the instantiation do not:
v1.compiler.infer,resolved_callable_typeover the callee's params);std.key_relationcorrectly only because that module spells the record's slot and the wrapper's generic identically (Subject). The control, which spells themSubjectandS, stayed unbounded.So the join is read from the type the literal is checked against. At a fn's result position that is the declared return type, whose arguments are authored: the callee's i-th value parameter is a bounded callee generic; the record declaration's field is an arrow whose i-th argument is the declaration's k-th slot; the return type passes one of the fn's own generics at slot k.
Declared boundary: a record literal in result position (the body, or the tail of a let / block / if / match / return) whose type is the return type's head, with bare-slot arrow arguments. A literal elsewhere contributes nothing rather than being guessed at from the return type. Next-rung trigger: a specimen storing a generic fn in a literal outside result position, which needs the expected type carried to the literal.
The hop this manufactures, fixed in the same PR
Bounding
key_relation_globalmade its caller owe the bound:key_resource_relation_globalforwards its ownfn(Subject) -> Keyinto it. The call-forwarding join reads a type's head and one type argument, and an arrow has neither, so that caller stayed bare and the error moved one fn up (std_key_relation.rs:138, observed in the intermediate run).v1_call_forwarding_forwarded_param_namesnow also joins arrow-typed parameters by argument position. Without it this rule trades one error for another, so it is not split out.The callee's full bound (own body, what it calls, what it stores) is extracted to
v1_callee_clone_bound_param_names, so the call site and the function-value site ask one derivation.Evidence (one remote dispatch, amd64 runner, branch head b30646e plus the regenerated mirror)
Native emission control (
gunbc test //gunbc/instruments:native-emission-controls, four newfn_value_*cases; callee genericT, record slotSubject, wrapper genericS, plus acontrol_keying_viahop):S: Cloneatcontrol_keying-D warnings,warning_count=0held(6 from rule 1, 4 new)Textual witness (
test.claim.generic_item_clone_bound_witness, two new arms, both executedtruein that dispatch viagunbc run --function):hdr_keying<S: Clone + 'static, K: 'static>and the hophdr_keying_via<A: Clone + 'static, B: 'static>; converse arms thatK/Bgain noCloneand that a fn storing only the values it was handed (hdr_keying_plain) keepsSwithoutClone.Regen:
claim_executor --required-regendrifted onv1_compiler_emit_rust.rsonly; after installing itfirst_generation_equal=trueand--required-regen-fixed-pointreportsfixed_point_equal=true. No other mirror changed, so neither the function-value rule nor the arrow-argument join added a bound to any emitted seed fn.Error delta
std.key_relationclosure (--entry dag/std/key_relation.dag, 12 files)The remaining one is
std_key_relation.rs:132E0282 "type annotations needed", a different class and not this lane's.Approval broker, paired (one dispatch; this head 8cb6e7f and its main base 63128f5, same runner, both with the
approval_store_receiptfilter hoisted locally for the probe only; errors joined by module and message with line numbers stripped):Only in base: the two
std_key_relation.rsE0277Subject: Clone. Only in head: nothing. So the rule removes exactly its two class-A errors and neither it nor the arrow-argument join adds an error anywhere in the broker closure. (This base is main before lane 1A's closure cut lands, hence 887 rather than the 253 census figure.)Class A after this PR, at this base: 13 errors, all owned elsewhere -- 10 at
std_access.rs(lane 2K, leaf-keyed index) and 3 atstd_authorization_profile.rs:74/85(gunbc#13078, Set-elementOrd).🤖 Generated with Claude Code