Skip to content

Commit 5d7db93

Browse files
authored
Rollup merge of rust-lang#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.
2 parents 58d0730 + 19d5568 commit 5d7db93

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

src/tools/tidy/src/issues.txt

-3
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ ui/consts/issue-68684.rs
795795
ui/consts/issue-69191-ice-on-uninhabited-enum-field.rs
796796
ui/consts/issue-69310-array-size-lit-wrong-ty.rs
797797
ui/consts/issue-69312.rs
798-
ui/consts/issue-69488.rs
799798
ui/consts/issue-69532.rs
800799
ui/consts/issue-6991.rs
801800
ui/consts/issue-70773-mir-typeck-lt-norm.rs
@@ -2745,14 +2744,12 @@ ui/lint/issue-111359.rs
27452744
ui/lint/issue-112489.rs
27462745
ui/lint/issue-117949.rs
27472746
ui/lint/issue-121070-let-range.rs
2748-
ui/lint/issue-14309.rs
27492747
ui/lint/issue-14837.rs
27502748
ui/lint/issue-17718-const-naming.rs
27512749
ui/lint/issue-1866.rs
27522750
ui/lint/issue-19102.rs
27532751
ui/lint/issue-20343.rs
27542752
ui/lint/issue-30302.rs
2755-
ui/lint/issue-34798.rs
27562753
ui/lint/issue-35075.rs
27572754
ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs
27582755
ui/lint/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs

tests/ui/consts/issue-69488.rs renamed to tests/ui/consts/load-preserves-partial-init.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ run-pass
22

33
#![feature(const_ptr_write)]
4+
// issue: https://github.com/rust-lang/rust/issues/69488
5+
// Loads of partially-initialized data could produce completely-uninitialized results.
6+
// Test to make sure that we no longer do such a "deinitializing" load.
47

58
// Or, equivalently: `MaybeUninit`.
69
pub union BagOfBits<T: Copy> {

tests/ui/lint/issue-34798.rs renamed to tests/ui/lint/improper_ctypes/allow-phantomdata-in-ffi.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ run-pass
22
#![forbid(improper_ctypes)]
33
#![allow(dead_code)]
4+
// issue https://github.com/rust-lang/rust/issues/34798
5+
// We allow PhantomData in FFI so bindgen can bind templated C++ structs with "unused generic args"
46

57
#[repr(C)]
68
pub struct Foo {

tests/ui/lint/issue-14309.rs renamed to tests/ui/lint/improper_ctypes/repr-rust-is-undefined.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#![deny(improper_ctypes)]
22
#![allow(dead_code)]
33

4+
// issue https://github.com/rust-lang/rust/issues/14309
5+
// Validates we lint on repr(Rust) structs and not repr(C) structs in FFI, to implement RFC 79:
6+
// https://rust-lang.github.io/rfcs/0079-undefined-struct-layout.html
7+
48
struct A {
59
x: i32
610
}

tests/ui/lint/issue-14309.stderr renamed to tests/ui/lint/improper_ctypes/repr-rust-is-undefined.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
11
error: `extern` block uses type `A`, which is not FFI-safe
2-
--> $DIR/issue-14309.rs:30:15
2+
--> $DIR/repr-rust-is-undefined.rs:34:15
33
|
44
LL | fn foo(x: A);
55
| ^ not FFI-safe
66
|
77
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
88
= note: this struct has unspecified layout
99
note: the type is defined here
10-
--> $DIR/issue-14309.rs:4:1
10+
--> $DIR/repr-rust-is-undefined.rs:8:1
1111
|
1212
LL | struct A {
1313
| ^^^^^^^^
1414
note: the lint level is defined here
15-
--> $DIR/issue-14309.rs:1:9
15+
--> $DIR/repr-rust-is-undefined.rs:1:9
1616
|
1717
LL | #![deny(improper_ctypes)]
1818
| ^^^^^^^^^^^^^^^
1919

2020
error: `extern` block uses type `A`, which is not FFI-safe
21-
--> $DIR/issue-14309.rs:31:15
21+
--> $DIR/repr-rust-is-undefined.rs:35:15
2222
|
2323
LL | fn bar(x: B);
2424
| ^ not FFI-safe
2525
|
2626
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
2727
= note: this struct has unspecified layout
2828
note: the type is defined here
29-
--> $DIR/issue-14309.rs:4:1
29+
--> $DIR/repr-rust-is-undefined.rs:8:1
3030
|
3131
LL | struct A {
3232
| ^^^^^^^^
3333

3434
error: `extern` block uses type `A`, which is not FFI-safe
35-
--> $DIR/issue-14309.rs:33:15
35+
--> $DIR/repr-rust-is-undefined.rs:37:15
3636
|
3737
LL | fn qux(x: A2);
3838
| ^^ not FFI-safe
3939
|
4040
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
4141
= note: this struct has unspecified layout
4242
note: the type is defined here
43-
--> $DIR/issue-14309.rs:4:1
43+
--> $DIR/repr-rust-is-undefined.rs:8:1
4444
|
4545
LL | struct A {
4646
| ^^^^^^^^
4747

4848
error: `extern` block uses type `A`, which is not FFI-safe
49-
--> $DIR/issue-14309.rs:34:16
49+
--> $DIR/repr-rust-is-undefined.rs:38:16
5050
|
5151
LL | fn quux(x: B2);
5252
| ^^ not FFI-safe
5353
|
5454
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
5555
= note: this struct has unspecified layout
5656
note: the type is defined here
57-
--> $DIR/issue-14309.rs:4:1
57+
--> $DIR/repr-rust-is-undefined.rs:8:1
5858
|
5959
LL | struct A {
6060
| ^^^^^^^^
6161

6262
error: `extern` block uses type `A`, which is not FFI-safe
63-
--> $DIR/issue-14309.rs:36:16
63+
--> $DIR/repr-rust-is-undefined.rs:40:16
6464
|
6565
LL | fn fred(x: D);
6666
| ^ not FFI-safe
6767
|
6868
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
6969
= note: this struct has unspecified layout
7070
note: the type is defined here
71-
--> $DIR/issue-14309.rs:4:1
71+
--> $DIR/repr-rust-is-undefined.rs:8:1
7272
|
7373
LL | struct A {
7474
| ^^^^^^^^

0 commit comments

Comments
 (0)