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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern_fat_drop.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-C-non-FFI-safe-arg-ice-52334.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
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 add issue numbers via // issue: rust-lang/rust#ISSUE_NUM directive 2024-03-24 09:34:11 +01:00
extern-C-str-arg-ice-80125.stderr add test for str as extern "C" arg causes compiler panic #80125 2024-03-24 09:23:12 +01:00
extern-calling-convention-test.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-compare-with-return-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-const.fixed Use the rustc_private libc less in tests 2024-04-15 08:54:11 -04:00
extern-const.rs Use the rustc_private libc less in tests 2024-04-15 08:54:11 -04:00
extern-const.stderr Make parse error suggestions verbose and fix spans 2024-07-12 03:02:57 +00:00
extern-crate-multiple-missing.rs
extern-crate-multiple-missing.stderr
extern-crate-rename.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-mod-abi.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-mod-ordering-exe.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-no-mangle.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-no-mangle.stderr
extern-prelude-core.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-prelude-no-speculative.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-prelude-std.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-pub.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-rust.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-static-size-overflow.rs
extern-static-size-overflow.stderr
extern-take-value.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-thiscall.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-types-field-offset.run.stderr Bless tests 2024-08-02 11:34:54 +00:00
extern-types-inherent-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-types-manual-sync-send.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-types-not-sync-send.rs
extern-types-not-sync-send.stderr
extern-types-pointer-cast.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-types-size_of_val.align.run.stderr Bless tests 2024-08-02 11:34:54 +00:00
extern-types-size_of_val.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-types-size_of_val.size.run.stderr Bless tests 2024-08-02 11:34:54 +00:00
extern-types-thin-pointer.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-types-trait-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-types-unsized.rs
extern-types-unsized.stderr review comment: change wording 2024-02-01 03:31:03 +00:00
extern-vectorcall.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-with-type-bounds.rs
extern-with-type-bounds.stderr
extern-wrong-value-type.rs
extern-wrong-value-type.stderr Use parenthetical notation for Fn traits 2024-05-29 22:26:54 +00:00
issue-1251.rs Remove libc from rust_get_test_int uses 2024-04-17 09:18:14 -04:00
issue-10025.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-10763.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-10764-rpass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-13655.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-16250.rs Move some tests 2024-02-09 15:43:08 -03:00
issue-16250.stderr Move some tests 2024-02-09 15:43:08 -03:00
issue-18576.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-18819.rs Move tests 2024-02-13 18:08:25 -03:00
issue-18819.stderr Use ordinal number in argument error 2024-07-14 13:50:09 +09:00
issue-28324.rs Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
issue-28324.stderr Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
issue-36122-accessing-externed-dst.rs Continue compilation after check_mod_type_wf errors 2024-02-14 11:00:30 +00:00
issue-36122-accessing-externed-dst.stderr Continue compilation after check_mod_type_wf errors 2024-02-14 11:00:30 +00:00
issue-47725.rs Move some tests 2024-02-09 15:43:08 -03:00
issue-47725.stderr Move some tests 2024-02-09 15:43:08 -03:00
issue-64655-allow-unwind-when-calling-panic-directly.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-64655-extern-rust-must-allow-unwind.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-80074.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-80074.stderr exclude unexported macro bindings from extern crate 2024-01-21 20:24:40 +08:00
issue-95829.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-95829.stderr Fix diagnostic for qualifier in extern block 2024-04-04 11:58:38 +02:00
issue-112363-extern-item-where-clauses-debug-ice.rs
issue-112363-extern-item-where-clauses-debug-ice.stderr Bless tests 2024-01-13 12:46:58 -05:00
issue-116203.rs
issue-116203.stderr
no-mangle-associated-fn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
no-mangle-associated-fn.stderr Update tests 2024-02-07 10:42:01 +08:00
not-in-block.rs
not-in-block.stderr