mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
198a68df1c
Add a special case for `CStr`/`CString` in the `improper_ctypes` lint Revives #120176. Just needed to bless a test and fix an argument, but seemed reasonable to me otherwise. Instead of saying to "consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct", we now tell users to "Use `*const ffi::c_char` instead, and pass the value from `CStr::as_ptr()`" when the type involved is a `CStr` or a `CString`. The suggestion is not made for `&mut CString` or `*mut CString`. r? ``````@cjgillot`````` (since you were the reviewer of the original PR #120176, but feel free to reroll) |
||
---|---|---|
.. | ||
alloc | ||
backtrace@72265bea21 | ||
core | ||
panic_abort | ||
panic_unwind | ||
portable-simd | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@d9466edb4c | ||
sysroot | ||
test | ||
unwind | ||
windows_targets | ||
Cargo.lock | ||
Cargo.toml |