Diagnostics in FFI use recommend users to cast to i/u8 instead of the appropriate c_char #89325
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Note: related to the lint described in #79089
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=e4aed9f0b25f39886e30db193cf508e2
The current output is:
Ideally the output should look like:
c_char
is different on platforms, it may beu8
ori8
. The correct cast here in FFI use is towards ac_char
, keeping casts correct in all situations. There's also an argument to be made that i8 -> c_char should be using anas
cast.The text was updated successfully, but these errors were encountered: