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
This appears to have been fixed fortuitously. I added a test case -- src/test/run-pass/issue-2214.rs -- which I believe tests the same issue, and it passes. Closing.
So... I am looking at this test now... casting a *int to a *c_int does not seem like a particularly good idea, as int and c_int have different sizes. I guess int is strictly larger than c_int, so this probably works out ok on a little-endian machine, but in general it's not something we want in our libraries.
No, they are not the same. That's why we give a warning if you use Rust int in the definition of a native function. A rust int is the same as C's intptr_t
Kobzol
pushed a commit
to Kobzol/rust
that referenced
this issue
Jan 21, 2025
Passing a v: &mut int to a function in a native module that expects a &mut c_int via a type cast v as &mut c_int yields an internal compiler error
I hit this when rewriting math and am logging this here.
The text was updated successfully, but these errors were encountered: