You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Facade grammar: a producer taking an optional parent (curl_mime_init(easy), NULL allowed since 7.87.0) is presented on the parent and collides with its new #3122
curl_mime_init(CURL *easy) is presented as a method of Easy and collides with Easy.new ("function 'Easy.new' is already defined") even with rename new on the mime producer; param easy fixed null then hits the "a resource is passed by the value that owns it" refusal (the NULL-on-create issue). curl_mime_init(3): since 7.87.0 the easy handle may be NULL and the mime depends on no easy handle.
Need: (a) a rename on a producer names the produced resource's constructor (Mime.new), never the parameter's type; (b) an optional parent parameter, presented as absent or Option[&Easy], with independent stating no lifetime tie when absent.
Done when: Mime.new() presents, no collision; fixture.
Reproduced on main 26eb17e with a 9-line header (two resources, curl_mime_init(easy *) a producer of the second).
What happens. A producer whose first parameter receives a resource is presented as a method of that resource (db.prepare() → Statement), so curl_mime_init is easy.mime_init(). rename new on it renames that method, giving a second Easy.new: 'function Easy.new is already defined'. That part is the rule working as written, not a bug.
A bug beside it:with analyze … contract prints producer: curl_mime_init -> Mime.new for the same contract, while the rendering puts it on Easy. The view names the wrong host. That is mine to fix and needs no ruling.
Needs Eric (presentation rules, §16.2b.4 and §16.2b.11):
Should rename on a producer be able to move it to the produced resource (Mime.new(e)), or should there be a spelling that says 'a constructor of the produced type, taking the parent as an argument'? Today the host is always the first parameter's resource.
The optional parent: curl_mime_init(NULL) is legal since 7.87.0. A producer that takes Option[&Easy], with the result independent when it is absent, has no clause. param easy fixed null is refused ('a resource is passed by the value that owns it').
Prediction: yes to a constructor on the produced type when the contract says so (the caller thinks 'make a Mime', not 'ask an Easy for one'), 65%; the optional parent as nullable param N on a producer with independent, 60%.
Correction to my comment above, after running both call forms on main 26eb17e: the contract view is right, and there is no view bug.
A producer whose first parameter receives a resource is presented twice: as a constructor of the produced type (Mime.curl_mime_init(e)) and as a method of the parameter's resource (e.curl_mime_init()). Both compile and run (they print the same value in my 9-line fixture). rename new renames both, and the second lands on Easy.new, which is the collision.
So question 1 for Eric is sharper than I wrote it: when a producer is renamed, should the rename apply to the constructor only (Mime.new(e)), with the method on the parent keeping its C-derived name or going away? The two presentations of one function are also worth a look in their own right: one meaning, two spellings.
Ruled, 2026-11-18 (D214): one home chosen by of (no of: a method of the first resource received; of Mime: a constructor of the produced type, no forwarder); an absent parent is a second constructor (Mime.new() beside Mime.with(e)), stated with param N fixed null as a cited claim that may carry a version floor; two entries for one C name, each with its own rename, settled in the same change. Count the call sites of the spelling that goes away first; its error offers the surviving one.
State against the ruling (D214), measured on main 21ec8b4 with a 7-line header (easy, mime, mime_init(easy *)):
Done: one home chosen by of (SemaFacade.with:57, FacadeRender.with:1245, SemaCheck.with:38859; §16.2b.4 has the words).
Not done, two parts:
param N fixed null on a resource parameter. Still refused at SemaFacade.with:2262 ("receives a modeled resource; a resource is passed by the value that owns it, never fixed"). The ruled meaning: on a producer, it makes a constructor of the produced type with no parent, and the value it returns depends on nothing.
Two entries for one C name.collect_facade_fn (SemaFacade.with:1446) refuses a second fn item for the same function in one facade, and its help text already promises what the ruling asks ("give each item its own 'rename'"). The model underneath is one contract per C function (foreign_contract_index: fn sym -> index, read in 283 places in SemaFacade.with), so the second entry needs an operation identity of (function, which parameters are fixed), in the collector, the verifier, the renderer and the call-site lookup.
One thing in the ruling's example that cannot be written today:Mime.with(e). rename with fails to parse because with is a reserved word ("expected identifier"). Either the example takes another name (Mime.from(e), Mime.of(e)), or a method name after rename may be a keyword as a member name after . already may. That is a wording point for the spec diff, not a blocker.
Still to settle in the same change (the ruling says so): the spelling of the version floor on the claim ("holds since 7.87.0"), and the refusal against an older pinned package.
This is mine to implement; it is ruled. Fixture for the done-when: the header above, Mime.new() beside the parented constructor, no collision with Easy.new.
Part 1 of D214 is merged (#3588): on a producer, param N fixed null on its resource parameter is the absent parent. Mime.new() presents on the produced type, does not collide with the parent's new, and its value depends on nothing. Fixture: behav_d214_producer_with_absent_parent.
Proposed words for §16.2b.11, for Eric to bless or replace (not landed):
On a producer, param N fixed null may name a parameter that receives a resource. It states that the function accepts no parent there: the constructor takes none, and the value it returns depends on nothing through that parameter. That NULL is accepted is the contract's claim. On every other operation a parameter that receives a resource is passed by the value that owns it and cannot be fixed.
Left for this issue (the rest of D214):
Two fn items for one C function, so Mime.new() and the parented constructor can both exist. Today a facade may describe mime_init once, so a contract chooses one of the two.
The version floor on the claim ("holds since 7.87.0") and the refusal against an older pinned package.
The ruling's example name Mime.with(e) cannot be written: with is a reserved word after rename.
Further on part 2 (two fn items for one C function), measured on a local branch on top of #3588:
Two items with distinct renames already work in general (ruling Amendment 3: each later item gets its own declaration linked to the same C symbol, facade_render_presentation_aliases). What was missing for a producer: the second presentation was treated as an operation on the parent, not as a producer. With the resource's from clause repeated for the presentation's declaration (one function in the renderer, written and building locally), the contract below is accepted and renders type Mime ephemeral { parent: Option[&Easy], … } with both constructors:
fn mime_init
of Mime
rename from_easy
fn mime_init
rename new
param 0 fixed null
What still refuses the program is the checker, not the facade.Mime.from_easy(e).unwrap() is accepted. Mime.new().unwrap() is refused: bound directly, "binds a view into a temporary Option[Mime]"; bound first and returned, "returned ephemeral value may outlive its origin 'made'", with the note that Mime depends on Easy. The type is a view-carrying type as soon as one constructor has a parent, and the origin rules then treat every value of it as borrowed from something, including the one whose parent slot is None.
That is the point the ruling makes ("dependency belongs to a value's origin, not to its type") and the piece it names under Alternatives as needing origin analysis. The work left is in SemaCheck (the view-producer and returned-ephemeral rules), not in the facade: a value of an ephemeral type that no argument could have given an origin has none.
So today a contract can state either constructor (the absent-parent one alone is merged and usable); both together wait on that checker change. The facade half is a local commit and will land with it.
Both constructors now work together (#3589): Mime.from_easy(e) tied to its parent and Mime.new() free, for one C function. Fixtures: behav_d214_both_constructors, err_d214_parented_value_outlives_parent.
One thing in that PR is wider than facades and is flagged here for Eric's veto: the checker no longer reads the by-value result of a builtin that consumes its receiver (unwrap, expect, … on an Option or Result held by value) as a view of that receiver. It carries the receiver's origins instead. It is what the ruling's "dependency belongs to a value's origin, not to its type" needs, and the refusals for a reference result or a borrowed receiver are unchanged.
What is left on this issue, all three for Eric:
Bless or replace the proposed §16.2b.11 words (above), plus one sentence that a second presentation of a producer is a producer.
The version floor on the claim ("holds since 7.87.0") and its spelling.
The example name Mime.with(e): with cannot follow rename.
Implemented, in the PR that follows this comment: param N fixed L since V with its refusal against an older pinned release, and a keyword after rename.
Two sentences for §16.2b.11, for Eric to bless or replace (not landed):
A param N fixed clause may end with since V, the release of the package from which the claim holds. A project that pins an earlier release of that package is refused.
The name after rename is a member name and may be a keyword.
Ruled by Eric, 2026-11-25 (third answer): yes to sentence 2 as written; the docs PR waits on two fixes to since V.
Comparison. Dotted numeric parts compare numerically (a missing part is 0); a trailing ASCII letter suffix orders after the base release, in order (1.1.1 < 1.1.1a < 1.1.1w); a -prerelease suffix orders before the bare release (3.0.0-beta2 < 3.0.0). A release string that does not fit that format is refused, never silently trimmed. Tests for OpenSSL-style and prerelease releases.
No pinned release: fail closed. A since V claim on a package with no pinned release is refused. Test.
"Only fixed takes it" stays out of the spec.
Then the docs PR lands sentence 2 as written and sentence 1 as:
A param N fixed clause may end with since V, the release of the package from which the claim holds. Releases compare by dotted numeric parts (missing parts as 0), with trailing letter suffixes ordered after the base release and -prerelease suffixes ordered before it. A project that pins an earlier release—or pins no release—of that package is refused.
Activity
ehartford commentedon Nov 18, 2026
Reproduced on main 26eb17e with a 9-line header (two resources,
curl_mime_init(easy *)a producer of the second).What happens. A producer whose first parameter receives a resource is presented as a method of that resource (
db.prepare()→Statement), socurl_mime_initiseasy.mime_init().rename newon it renames that method, giving a secondEasy.new: 'function Easy.new is already defined'. That part is the rule working as written, not a bug.A bug beside it:
with analyze … contractprintsproducer: curl_mime_init -> Mime.newfor the same contract, while the rendering puts it onEasy. The view names the wrong host. That is mine to fix and needs no ruling.Needs Eric (presentation rules, §16.2b.4 and §16.2b.11):
renameon a producer be able to move it to the produced resource (Mime.new(e)), or should there be a spelling that says 'a constructor of the produced type, taking the parent as an argument'? Today the host is always the first parameter's resource.curl_mime_init(NULL)is legal since 7.87.0. A producer that takesOption[&Easy], with the result independent when it is absent, has no clause.param easy fixed nullis refused ('a resource is passed by the value that owns it').Prediction: yes to a constructor on the produced type when the contract says so (the caller thinks 'make a Mime', not 'ask an Easy for one'), 65%; the optional parent as
nullable param Non a producer withindependent, 60%.ehartford commentedon Nov 18, 2026
Correction to my comment above, after running both call forms on main 26eb17e: the contract view is right, and there is no view bug.
A producer whose first parameter receives a resource is presented twice: as a constructor of the produced type (
Mime.curl_mime_init(e)) and as a method of the parameter's resource (e.curl_mime_init()). Both compile and run (they print the same value in my 9-line fixture).rename newrenames both, and the second lands onEasy.new, which is the collision.So question 1 for Eric is sharper than I wrote it: when a producer is renamed, should the rename apply to the constructor only (
Mime.new(e)), with the method on the parent keeping its C-derived name or going away? The two presentations of one function are also worth a look in their own right: one meaning, two spellings.ehartford commentedon Nov 18, 2026
Ruled, 2026-11-18 (D214): one home chosen by
of(noof: a method of the first resource received;of Mime: a constructor of the produced type, no forwarder); an absent parent is a second constructor (Mime.new()besideMime.with(e)), stated withparam N fixed nullas a cited claim that may carry a version floor; two entries for one C name, each with its ownrename, settled in the same change. Count the call sites of the spelling that goes away first; its error offers the surviving one.Spec v7.63: 'buffer field P remaining field N' (D210); D213 to D216 r…
ehartford commentedon Nov 24, 2026
State against the ruling (D214), measured on main 21ec8b4 with a 7-line header (
easy,mime,mime_init(easy *)):Done: one home chosen by
of(SemaFacade.with:57, FacadeRender.with:1245, SemaCheck.with:38859; §16.2b.4 has the words).Not done, two parts:
param N fixed nullon a resource parameter. Still refused at SemaFacade.with:2262 ("receives a modeled resource; a resource is passed by the value that owns it, never fixed"). The ruled meaning: on a producer, it makes a constructor of the produced type with no parent, and the value it returns depends on nothing.collect_facade_fn(SemaFacade.with:1446) refuses a second fn item for the same function in one facade, and its help text already promises what the ruling asks ("give each item its own 'rename'"). The model underneath is one contract per C function (foreign_contract_index: fn sym -> index, read in 283 places in SemaFacade.with), so the second entry needs an operation identity of (function, which parameters are fixed), in the collector, the verifier, the renderer and the call-site lookup.One thing in the ruling's example that cannot be written today:
Mime.with(e).rename withfails to parse becausewithis a reserved word ("expected identifier"). Either the example takes another name (Mime.from(e),Mime.of(e)), or a method name afterrenamemay be a keyword as a member name after.already may. That is a wording point for the spec diff, not a blocker.Still to settle in the same change (the ruling says so): the spelling of the version floor on the claim ("holds since 7.87.0"), and the refusal against an older pinned package.
This is mine to implement; it is ruled. Fixture for the done-when: the header above,
Mime.new()beside the parented constructor, no collision withEasy.new.On a producer, a parent fixed to null is the absent parent: the const…
ehartford commentedon Nov 24, 2026
Part 1 of D214 is merged (#3588): on a producer,
param N fixed nullon its resource parameter is the absent parent.Mime.new()presents on the produced type, does not collide with the parent'snew, and its value depends on nothing. Fixture:behav_d214_producer_with_absent_parent.Proposed words for §16.2b.11, for Eric to bless or replace (not landed):
Left for this issue (the rest of D214):
Mime.new()and the parented constructor can both exist. Today a facade may describemime_initonce, so a contract chooses one of the two.Mime.with(e)cannot be written:withis a reserved word afterrename.ehartford commentedon Nov 24, 2026
Further on part 2 (two fn items for one C function), measured on a local branch on top of #3588:
facade_render_presentation_aliases). What was missing for a producer: the second presentation was treated as an operation on the parent, not as a producer. With the resource'sfromclause repeated for the presentation's declaration (one function in the renderer, written and building locally), the contract below is accepted and renderstype Mime ephemeral { parent: Option[&Easy], … }with both constructors:Mime.from_easy(e).unwrap()is accepted.Mime.new().unwrap()is refused: bound directly, "binds a view into a temporaryOption[Mime]"; bound first and returned, "returned ephemeral value may outlive its origin 'made'", with the note thatMimedepends onEasy. The type is a view-carrying type as soon as one constructor has a parent, and the origin rules then treat every value of it as borrowed from something, including the one whose parent slot isNone.That is the point the ruling makes ("dependency belongs to a value's origin, not to its type") and the piece it names under Alternatives as needing origin analysis. The work left is in
SemaCheck(the view-producer and returned-ephemeral rules), not in the facade: a value of an ephemeral type that no argument could have given an origin has none.So today a contract can state either constructor (the absent-parent one alone is merged and usable); both together wait on that checker change. The facade half is a local commit and will land with it.
One C function, two constructors: a producer's second presentation is…
ehartford commentedon Nov 24, 2026
Both constructors now work together (#3589):
Mime.from_easy(e)tied to its parent andMime.new()free, for one C function. Fixtures:behav_d214_both_constructors,err_d214_parented_value_outlives_parent.One thing in that PR is wider than facades and is flagged here for Eric's veto: the checker no longer reads the by-value result of a builtin that consumes its receiver (
unwrap,expect, … on anOptionorResultheld by value) as a view of that receiver. It carries the receiver's origins instead. It is what the ruling's "dependency belongs to a value's origin, not to its type" needs, and the refusals for a reference result or a borrowed receiver are unchanged.What is left on this issue, all three for Eric:
Mime.with(e):withcannot followrename.Labelling
human attn neededfor those.ehartford commentedon Nov 25, 2026
Ruled by Eric, 2026-11-25 (answers to briefs.md).
param 0 fixed null since 7.87.0. The floor belongs to that claim.rename, matching the rule after..unwrap/expectorigins change of One C function, two constructors: a producer's second presentation is a producer, and a parentless value of a parented type is free (D214, part of #3122) #3589.Label removed; the words, the
sincesuffix with its refusal against an older pinned package, and the keyword afterrenameare mine.ehartford commentedon Nov 25, 2026
Implemented, in the PR that follows this comment:
param N fixed L since Vwith its refusal against an older pinned release, and a keyword afterrename.Two sentences for §16.2b.11, for Eric to bless or replace (not landed):
A claim may state the release it holds from (param N fixed L since V)…
ehartford commentedon Nov 26, 2026
Ruled by Eric, 2026-11-25 (third answer): yes to sentence 2 as written; the docs PR waits on two fixes to
since V.1.1.1<1.1.1a<1.1.1w); a-prereleasesuffix orders before the bare release (3.0.0-beta2<3.0.0). A release string that does not fit that format is refused, never silently trimmed. Tests for OpenSSL-style and prerelease releases.since Vclaim on a package with no pinned release is refused. Test.fixedtakes it" stays out of the spec.Then the docs PR lands sentence 2 as written and sentence 1 as: