rust/compiler/rustc_lint
Trevor Gross 198a68df1c
Rollup merge of #128735 - jieyouxu:pr-120176-revive, r=cjgillot
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)
2024-08-24 21:03:31 -05:00
..
src Rollup merge of #128735 - jieyouxu:pr-120176-revive, r=cjgillot 2024-08-24 21:03:31 -05:00
Cargo.toml non_local_defs: point to Self and Trait to give more context 2024-05-27 23:59:18 +02:00
messages.ftl Rollup merge of #128735 - jieyouxu:pr-120176-revive, r=cjgillot 2024-08-24 21:03:31 -05:00