diff options
| author | Flying-Toast <38232168+Flying-Toast@users.noreply.github.com> | 2024-03-23 10:49:05 -0400 |
|---|---|---|
| committer | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2024-08-06 13:56:59 +0000 |
| commit | b335ec9ec8d1132efee4e900a1c173efc7f4a357 (patch) | |
| tree | cb0683b9e2c6672f3a079c4b54e55ac5693e9604 /compiler/rustc_span/src | |
| parent | 93ea767e2928589b74296ba85b57d80e108db712 (diff) | |
| download | rust-b335ec9ec8d1132efee4e900a1c173efc7f4a357.tar.gz rust-b335ec9ec8d1132efee4e900a1c173efc7f4a357.zip | |
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>
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 94cf21da4ef..407f95a0f21 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -671,6 +671,7 @@ symbols! { crate_visibility_modifier, crt_dash_static: "crt-static", csky_target_feature, + cstr_type, cstring_type, ctlz, ctlz_nonzero, |
