Skip to content

Commit

Permalink
tests: issue-14309.* => repr-rust-is-undefined.*
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Sep 27, 2024
1 parent bcf8cf2 commit a1fbf25
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
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
|
= 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
|
= 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
|
= 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
|
= 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
|
= 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 {
| ^^^^^^^^
Expand Down

0 comments on commit a1fbf25

Please sign in to comment.