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 }}
Facade proof: an opaque typedef void CURL handle is refused as "a pointer to no record", taking the whole libcurl easy API raw #3123
curl_easy_init returns CURL *, and CURL is typedef void CURL, so the drafter sees *mut c_void and refuses it: "returns *mut c_void, a pointer to no record". Every easy function then lacks a resource to hang off.
An opaque handle behind typedef void T is a common C idiom (libcurl's CURL/CURLM/CURLSH, libuv-style handles, many vendor SDKs). The typedef name is evidence of identity even though the pointee is void: a pointer returned under a distinct typedef name, consumed by a function under the same name that frees it (curl_easy_cleanup(CURL *)), is a handle. The drafter should model the typedef as an opaque resource type (D121 evidence: producer and destroyer agree on the name), never collapse it to c_void.
Done when: with get c.libcurl presents Easy (init, cleanup, perform, reset) from the proof alone; the coverage table (#3116) shows the change.
The drafter keeps a void typedef's name in the types it reasons over (*mut CURL), so a name a producer returns and a destroyer frees is a resource, and an operation on such a handle states of <Resource>. c_import still aliases the typedef to c_void: a distinct type would also catch pure synonyms (GLvoid, where const GLvoid * means any pointer), and the header cannot tell a handle from a synonym, so identity comes from evidence.
libcurl's producer and destroyer go through a pointer to the pointer (Curl_open(&data), Curl_close(&data)); those shapes are now proven from the callee's body.
On libcurl 8.23.0: resource CURLHandle wraps *mut CURL with from curl_easy_init and drop curl_easy_cleanup, likewise the share pair; 21 of 100 functions presented (was 17). A program with no unsafe builds, makes an easy handle and drops it.
Not done by this issue: setopt, perform, reset and the rest stay raw for #3124 (each reaches the program's debug callback through the fdebug field, which nothing declares). curl_multi_init is still unproven.
Activity
#3123: a handle behind `typedef void T` is a resource when a producer…
#3123: slot producers and destroyers are proven; a prototype c_import…
ehartford commentedon Nov 11, 2026
Fixed in #3262 and #3263.
*mut CURL), so a name a producer returns and a destroyer frees is a resource, and an operation on such a handle statesof <Resource>. c_import still aliases the typedef to c_void: a distinct type would also catch pure synonyms (GLvoid, whereconst GLvoid *means any pointer), and the header cannot tell a handle from a synonym, so identity comes from evidence.Curl_open(&data),Curl_close(&data)); those shapes are now proven from the callee's body.On libcurl 8.23.0:
resource CURLHandle wraps *mut CURLwithfrom curl_easy_initanddrop curl_easy_cleanup, likewise the share pair; 21 of 100 functions presented (was 17). A program with nounsafebuilds, makes an easy handle and drops it.Not done by this issue: setopt, perform, reset and the rest stay raw for #3124 (each reaches the program's debug callback through the
fdebugfield, which nothing declares). curl_multi_init is still unproven.