Rollup merge of #130953 - workingjubilee:rename-a-few-ctypes-tests, r=fee1-dead

Rename a few tests to make tidy happier

A somewhat random smattering of tests that I have recently looked at, and thus had cause to research and write down the reason for their existence.
This commit is contained in:
Matthias Krüger 2024-09-28 09:35:12 +02:00 committed by GitHub
commit 5d7db93600
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 14 deletions

View File

@ -795,7 +795,6 @@ ui/consts/issue-68684.rs
ui/consts/issue-69191-ice-on-uninhabited-enum-field.rs ui/consts/issue-69191-ice-on-uninhabited-enum-field.rs
ui/consts/issue-69310-array-size-lit-wrong-ty.rs ui/consts/issue-69310-array-size-lit-wrong-ty.rs
ui/consts/issue-69312.rs ui/consts/issue-69312.rs
ui/consts/issue-69488.rs
ui/consts/issue-69532.rs ui/consts/issue-69532.rs
ui/consts/issue-6991.rs ui/consts/issue-6991.rs
ui/consts/issue-70773-mir-typeck-lt-norm.rs ui/consts/issue-70773-mir-typeck-lt-norm.rs
@ -2745,14 +2744,12 @@ ui/lint/issue-111359.rs
ui/lint/issue-112489.rs ui/lint/issue-112489.rs
ui/lint/issue-117949.rs ui/lint/issue-117949.rs
ui/lint/issue-121070-let-range.rs ui/lint/issue-121070-let-range.rs
ui/lint/issue-14309.rs
ui/lint/issue-14837.rs ui/lint/issue-14837.rs
ui/lint/issue-17718-const-naming.rs ui/lint/issue-17718-const-naming.rs
ui/lint/issue-1866.rs ui/lint/issue-1866.rs
ui/lint/issue-19102.rs ui/lint/issue-19102.rs
ui/lint/issue-20343.rs ui/lint/issue-20343.rs
ui/lint/issue-30302.rs ui/lint/issue-30302.rs
ui/lint/issue-34798.rs
ui/lint/issue-35075.rs ui/lint/issue-35075.rs
ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs
ui/lint/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs ui/lint/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs

View File

@ -1,6 +1,9 @@
//@ run-pass //@ run-pass
#![feature(const_ptr_write)] #![feature(const_ptr_write)]
// issue: https://github.com/rust-lang/rust/issues/69488
// Loads of partially-initialized data could produce completely-uninitialized results.
// Test to make sure that we no longer do such a "deinitializing" load.
// Or, equivalently: `MaybeUninit`. // Or, equivalently: `MaybeUninit`.
pub union BagOfBits<T: Copy> { pub union BagOfBits<T: Copy> {

View File

@ -1,6 +1,8 @@
//@ run-pass //@ run-pass
#![forbid(improper_ctypes)] #![forbid(improper_ctypes)]
#![allow(dead_code)] #![allow(dead_code)]
// issue https://github.com/rust-lang/rust/issues/34798
// We allow PhantomData in FFI so bindgen can bind templated C++ structs with "unused generic args"
#[repr(C)] #[repr(C)]
pub struct Foo { pub struct Foo {

View File

@ -1,6 +1,10 @@
#![deny(improper_ctypes)] #![deny(improper_ctypes)]
#![allow(dead_code)] #![allow(dead_code)]
// issue https://github.com/rust-lang/rust/issues/14309
// Validates we lint on repr(Rust) structs and not repr(C) structs in FFI, to implement RFC 79:
// https://rust-lang.github.io/rfcs/0079-undefined-struct-layout.html
struct A { struct A {
x: i32 x: i32
} }

View File

@ -1,5 +1,5 @@
error: `extern` block uses type `A`, which is not FFI-safe error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:30:15 --> $DIR/repr-rust-is-undefined.rs:34:15
| |
LL | fn foo(x: A); LL | fn foo(x: A);
| ^ not FFI-safe | ^ not FFI-safe
@ -7,18 +7,18 @@ LL | fn foo(x: A);
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout = note: this struct has unspecified layout
note: the type is defined here note: the type is defined here
--> $DIR/issue-14309.rs:4:1 --> $DIR/repr-rust-is-undefined.rs:8:1
| |
LL | struct A { LL | struct A {
| ^^^^^^^^ | ^^^^^^^^
note: the lint level is defined here note: the lint level is defined here
--> $DIR/issue-14309.rs:1:9 --> $DIR/repr-rust-is-undefined.rs:1:9
| |
LL | #![deny(improper_ctypes)] LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:31:15 --> $DIR/repr-rust-is-undefined.rs:35:15
| |
LL | fn bar(x: B); LL | fn bar(x: B);
| ^ not FFI-safe | ^ not FFI-safe
@ -26,13 +26,13 @@ LL | fn bar(x: B);
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout = note: this struct has unspecified layout
note: the type is defined here note: the type is defined here
--> $DIR/issue-14309.rs:4:1 --> $DIR/repr-rust-is-undefined.rs:8:1
| |
LL | struct A { LL | struct A {
| ^^^^^^^^ | ^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:33:15 --> $DIR/repr-rust-is-undefined.rs:37:15
| |
LL | fn qux(x: A2); LL | fn qux(x: A2);
| ^^ not FFI-safe | ^^ not FFI-safe
@ -40,13 +40,13 @@ LL | fn qux(x: A2);
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout = note: this struct has unspecified layout
note: the type is defined here note: the type is defined here
--> $DIR/issue-14309.rs:4:1 --> $DIR/repr-rust-is-undefined.rs:8:1
| |
LL | struct A { LL | struct A {
| ^^^^^^^^ | ^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:34:16 --> $DIR/repr-rust-is-undefined.rs:38:16
| |
LL | fn quux(x: B2); LL | fn quux(x: B2);
| ^^ not FFI-safe | ^^ not FFI-safe
@ -54,13 +54,13 @@ LL | fn quux(x: B2);
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout = note: this struct has unspecified layout
note: the type is defined here note: the type is defined here
--> $DIR/issue-14309.rs:4:1 --> $DIR/repr-rust-is-undefined.rs:8:1
| |
LL | struct A { LL | struct A {
| ^^^^^^^^ | ^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:36:16 --> $DIR/repr-rust-is-undefined.rs:40:16
| |
LL | fn fred(x: D); LL | fn fred(x: D);
| ^ not FFI-safe | ^ not FFI-safe
@ -68,7 +68,7 @@ LL | fn fred(x: D);
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout = note: this struct has unspecified layout
note: the type is defined here note: the type is defined here
--> $DIR/issue-14309.rs:4:1 --> $DIR/repr-rust-is-undefined.rs:8:1
| |
LL | struct A { LL | struct A {
| ^^^^^^^^ | ^^^^^^^^