Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uppub type CFMutableDictionaryRef = *const __CFDictionary; #149
Comments
|
Also we have impl TCFTypeRef for *const T but not for *mut T. I ran into this when trying to update security-framework to a new version of core-foundation. |
|
@jrmuizel All ref types are Why do you need/want some of them to be |
|
Yes, |
|
Why *const? Since we're going to be mutating at least the refcount and sometimes the whole object pointed to by the ref type shouldn't they be *mut? |
|
@jrmuizel Every ref raw pointer definition in the crate, except for We never mutate any data behind the pointers inside this crate, or in Rust at all. We just pass the pointers to |
|
These C functions actually want |
|
@jrmuizel What practical problem does it cause to have |
|
All of the ref types here are mut. Do we have a justification for changing them to *const? |
|
I'm not sure. Because all of core-foundation use const and the ffi functions take const pointers, that's the only reason I can come up with. Maybe this crate should have everything |
|
Iff we come to the conclusion that it does not matter; then I would argue that the reason to change in |
|
@sfackler would you object to changing security-framework to use *const for it's ref types instead of *mut? |
|
(asked on IRC to toss in my two cents here) There's no language-level significance between That said, I personally don't think this hint is important enough to refactor your whole codebase over, but I believe sfackler cares about it more strongly. |
|
I like to match the C type definitions exactly, even when they're not const-correct. I'm going to do a big breaking release for security-framework soon so if there are changes needed on the securyt-framework side that's fine. |
Should this be *mut __CFDictionary?