1
Fork 0

Add a special case for CStr/CString in the improper_ctypes lint

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`.

Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
This commit is contained in:
Flying-Toast 2024-03-23 10:49:05 -04:00 committed by 许杰友 Jieyou Xu (Joe)
parent 93ea767e29
commit b335ec9ec8
7 changed files with 172 additions and 21 deletions

View file

@ -671,6 +671,7 @@ symbols! {
crate_visibility_modifier,
crt_dash_static: "crt-static",
csky_target_feature,
cstr_type,
cstring_type,
ctlz,
ctlz_nonzero,