rust/tests/ui/extern
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
..
auxiliary
extern_fat_drop.rs
extern-1.rs
extern-C-non-FFI-safe-arg-ice-52334.rs
extern-C-non-FFI-safe-arg-ice-52334.stderr Add a special case for CStr/CString in the improper_ctypes lint 2024-08-06 13:56:59 +00:00
extern-C-str-arg-ice-80125.rs
extern-C-str-arg-ice-80125.stderr
extern-calling-convention-test.rs
extern-compare-with-return-type.rs
extern-const.fixed
extern-const.rs
extern-const.stderr
extern-crate-multiple-missing.rs
extern-crate-multiple-missing.stderr
extern-crate-rename.rs
extern-crate-rename.stderr
extern-crate-visibility.rs
extern-crate-visibility.stderr
extern-ffi-fn-with-body.rs
extern-ffi-fn-with-body.stderr
extern-foreign-crate.rs
extern-macro.rs
extern-macro.stderr
extern-main-fn.rs
extern-main-fn.stderr
extern-main-issue-86110.rs
extern-main-issue-86110.stderr Use FnSig instead of raw FnDecl for ForeignItemKind::Fn 2024-08-16 14:10:06 -04:00
extern-methods.rs
extern-mod-abi.rs
extern-mod-ordering-exe.rs
extern-no-mangle.rs
extern-no-mangle.stderr
extern-prelude-core.rs
extern-prelude-no-speculative.rs
extern-prelude-std.rs
extern-pub.rs
extern-rust.rs
extern-static-size-overflow.rs
extern-static-size-overflow.stderr
extern-take-value.rs
extern-thiscall.rs
extern-type-diag-not-similar.rs
extern-type-diag-not-similar.stderr
extern-types-distinct-types.rs
extern-types-distinct-types.stderr
extern-types-field-offset.rs
extern-types-field-offset.run.stderr Bless tests 2024-08-02 11:34:54 +00:00
extern-types-inherent-impl.rs
extern-types-manual-sync-send.rs
extern-types-not-sync-send.rs
extern-types-not-sync-send.stderr
extern-types-pointer-cast.rs
extern-types-size_of_val.align.run.stderr Bless tests 2024-08-02 11:34:54 +00:00
extern-types-size_of_val.rs
extern-types-size_of_val.size.run.stderr Bless tests 2024-08-02 11:34:54 +00:00
extern-types-thin-pointer.rs
extern-types-trait-impl.rs
extern-types-unsized.rs
extern-types-unsized.stderr
extern-vectorcall.rs
extern-with-type-bounds.rs
extern-with-type-bounds.stderr
extern-wrong-value-type.rs
extern-wrong-value-type.stderr
issue-1251.rs
issue-10025.rs
issue-10763.rs
issue-10764-rpass.rs
issue-13655.rs
issue-16250.rs
issue-16250.stderr
issue-18576.rs
issue-18819.rs
issue-18819.stderr
issue-28324.rs
issue-28324.stderr
issue-36122-accessing-externed-dst.rs
issue-36122-accessing-externed-dst.stderr
issue-47725.rs
issue-47725.stderr
issue-64655-allow-unwind-when-calling-panic-directly.rs
issue-64655-extern-rust-must-allow-unwind.rs
issue-80074.rs
issue-80074.stderr
issue-95829.rs
issue-95829.stderr
issue-112363-extern-item-where-clauses-debug-ice.rs
issue-112363-extern-item-where-clauses-debug-ice.stderr
issue-116203.rs
issue-116203.stderr
no-mangle-associated-fn.rs
no-mangle-associated-fn.stderr
not-in-block.rs
not-in-block.stderr