Repository navigation
#3123: a handle behind typedef void T is a resource by evidence - #3262
Merged
Merged
Conversation
… returns it and a destroyer frees it A pointer the header spells through a typedef of void (`CURL *`) translates to `*mut c_void`, and the drafter read its producer as 'returns *mut c_void, a pointer to no record'. The proofs now keep the typedef's name in the signature types they reason over (`*mut CURL`, from the type as written), so the D121 evidence applies: a name a producer returns and a destroyer frees is a resource. Every void typedef is one representation to the checker, so an operation on such a handle states `of <Resource>`. c_import is unchanged: the typedef stays an alias of c_void. Making it a distinct type would also catch pure synonyms (`GLvoid`), where `const GLvoid *` means any pointer; the header cannot tell the two apart, so identity comes from evidence (law 4). A synonym gains no producer and stays raw. Test: test/internals/conan_facade_void_typedef_handle_test.w. Before, the same package drafted 'h_new: raw: returns *mut c_void, a pointer to no record' and an empty facade.
typedef void T is a resource by evidence
ehartford
marked this pull request as ready for review
November 11, 2026 21:15
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.
A pointer the header spells through a typedef of void (
CURL *) translates to*mut c_void; the drafter read its producer as 'a pointer to no record'. The proofs keep the typedef's name, so a name a producer returns and a destroyer frees is a resource, and an operation on it statesof <Resource>. c_import is unchanged: a distinct type would also catch pure synonyms (GLvoid); the header cannot tell the two apart, so identity comes from evidence (law 4).Test: test/internals/conan_facade_void_typedef_handle_test.w.
Battery: GREEN on the stack top 282e783 (seed-driven,
with uat --strict).