Open GCPanic opened 5 months ago
I agree that I think LLVMString
should be Send
(and maybe Sync
?), but I think your analysis is slightly off in that it's more like CString
, not CStr
. &CStr
(which is like &str
) shouldn't be Send
nor Sync
when the reference is non static.
it's more like
CString
, notCStr
.
Yes, you're right. LLVMString has string's ownership, it more like a CString.
&CStr (which is like &str) shouldn't be Send nor Sync when the reference is non static.
Not exactly, although thread::spawn does ask for values to be 'static, Send and Sync trait has nothing to do with lifetimes. And, infact, CStr does implements Send and Sync(which means &CStr also implements them)
Ah yeah, good point
Describe the Bug Currently, inkwell::support::LLVMString implementing
!Send
,!Sync
andDeref<Target = CStr>
. This is clearly incorrect, asCStr
implementingSend
andSync
.To Reproduce Unrelated
Expected Behavior
LLVMString
is just anCStr
with customDrop
, so it should be safe to send it's reference to other threads.On the other hands, i've searched some informations about LLVM Messages, and i don't found any documents saying it's not thread-safe. In this case,
LLVMString
should implementSend
as well.LLVM Version (please complete the following information):
Desktop (please complete the following information):
Additional Context None