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
In theory the second might be a bigger problem (since maybe it would cause the symbol not to point at the right thing), but in practice it doesn't seem like anything goes wrong. And I have no suggestion for an alternative.
The first is less subtle, and has a more obvious fix (ditch the mut), so it's probably worth fixing. That said, it's probably harmless (so long as you never write to it... which requires unsafe anyway).
The text was updated successfully, but these errors were encountered:
So this basically happens because clang is not able to evaluate some_static_string due to being external and at the same time clang_isConstQualifiedType returns false (not sure why though). This seems like a similar instance of #1727 so maybe we should special case incomplete arrays too.
For some reason, a C header containing a declaration like:
is compiled to a rust bindings file with the following declaration:
This is wrong for a few reasons:
static mut
, even though the input is a constant (in readonly memory, even).core::ptr::addr_of!
or similar): See Are statics confined to the size indicated by their type? unsafe-code-guidelines#259.In theory the second might be a bigger problem (since maybe it would cause the symbol not to point at the right thing), but in practice it doesn't seem like anything goes wrong. And I have no suggestion for an alternative.
The first is less subtle, and has a more obvious fix (ditch the
mut
), so it's probably worth fixing. That said, it's probably harmless (so long as you never write to it... which requiresunsafe
anyway).The text was updated successfully, but these errors were encountered: