From a1fbf251b81b165016d4f29ea9a9e08647275957 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Fri, 27 Sep 2024 14:04:42 -0700 Subject: [PATCH] tests: issue-14309.* => repr-rust-is-undefined.* --- src/tools/tidy/src/issues.txt | 1 - .../repr-rust-is-undefined.rs} | 4 ++++ .../repr-rust-is-undefined.stderr} | 22 +++++++++---------- 3 files changed, 15 insertions(+), 12 deletions(-) rename tests/ui/lint/{issue-14309.rs => improper_ctypes/repr-rust-is-undefined.rs} (70%) rename tests/ui/lint/{issue-14309.stderr => improper_ctypes/repr-rust-is-undefined.stderr} (79%) diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 9d3b090abb6e7..89535079772ef 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -2744,7 +2744,6 @@ ui/lint/issue-111359.rs ui/lint/issue-112489.rs ui/lint/issue-117949.rs ui/lint/issue-121070-let-range.rs -ui/lint/issue-14309.rs ui/lint/issue-14837.rs ui/lint/issue-17718-const-naming.rs ui/lint/issue-1866.rs diff --git a/tests/ui/lint/issue-14309.rs b/tests/ui/lint/improper_ctypes/repr-rust-is-undefined.rs similarity index 70% rename from tests/ui/lint/issue-14309.rs rename to tests/ui/lint/improper_ctypes/repr-rust-is-undefined.rs index 328a4c982b81e..379c4132404bf 100644 --- a/tests/ui/lint/issue-14309.rs +++ b/tests/ui/lint/improper_ctypes/repr-rust-is-undefined.rs @@ -1,6 +1,10 @@ #![deny(improper_ctypes)] #![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 { x: i32 } diff --git a/tests/ui/lint/issue-14309.stderr b/tests/ui/lint/improper_ctypes/repr-rust-is-undefined.stderr similarity index 79% rename from tests/ui/lint/issue-14309.stderr rename to tests/ui/lint/improper_ctypes/repr-rust-is-undefined.stderr index 9ce62a6b8044b..5f0465bcf00c7 100644 --- a/tests/ui/lint/issue-14309.stderr +++ b/tests/ui/lint/improper_ctypes/repr-rust-is-undefined.stderr @@ -1,5 +1,5 @@ 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); | ^ 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 = note: this struct has unspecified layout note: the type is defined here - --> $DIR/issue-14309.rs:4:1 + --> $DIR/repr-rust-is-undefined.rs:8:1 | LL | struct A { | ^^^^^^^^ 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)] | ^^^^^^^^^^^^^^^ 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); | ^ 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 = note: this struct has unspecified layout note: the type is defined here - --> $DIR/issue-14309.rs:4:1 + --> $DIR/repr-rust-is-undefined.rs:8:1 | LL | struct A { | ^^^^^^^^ 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); | ^^ 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 = note: this struct has unspecified layout note: the type is defined here - --> $DIR/issue-14309.rs:4:1 + --> $DIR/repr-rust-is-undefined.rs:8:1 | LL | struct A { | ^^^^^^^^ 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); | ^^ 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 = note: this struct has unspecified layout note: the type is defined here - --> $DIR/issue-14309.rs:4:1 + --> $DIR/repr-rust-is-undefined.rs:8:1 | LL | struct A { | ^^^^^^^^ 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); | ^ 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 = note: this struct has unspecified layout note: the type is defined here - --> $DIR/issue-14309.rs:4:1 + --> $DIR/repr-rust-is-undefined.rs:8:1 | LL | struct A { | ^^^^^^^^