Skip to content

Commit 63702ef

Browse files
committed
ImproperCTypes: rename associated tests
Rustc is trying to shift away from test names that are just issue numbers, so we add this as part of its effort, since this commit chain is moving and rewriting these files anyway. The directory containing all tests is also renamed.
1 parent cb4ffda commit 63702ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+113
-67
lines changed
File renamed without changes.

tests/ui/lint/improper_ctypes/allow_improper_ctypes.stderr renamed to tests/ui/lint/improper-ctypes/allow-improper-ctypes.stderr

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `extern` callback uses type `(i32, i32)`, which is not FFI-safe
2-
--> $DIR/allow_improper_ctypes.rs:39:20
2+
--> $DIR/allow-improper-ctypes.rs:39:20
33
|
44
LL | type UnsafeFnPtr = extern "C" fn((i32, i32))->i32;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -8,42 +8,42 @@ LL | type UnsafeFnPtr = extern "C" fn((i32, i32))->i32;
88
= help: consider using a struct instead
99
= note: tuples have unspecified layout
1010
note: the lint level is defined here
11-
--> $DIR/allow_improper_ctypes.rs:2:9
11+
--> $DIR/allow-improper-ctypes.rs:2:9
1212
|
1313
LL | #![deny(improper_c_callbacks)]
1414
| ^^^^^^^^^^^^^^^^^^^^
1515

1616
error: `extern` fn uses type `&str`, which is not FFI-safe
17-
--> $DIR/allow_improper_ctypes.rs:75:35
17+
--> $DIR/allow-improper-ctypes.rs:75:35
1818
|
1919
LL | extern "C" fn fn1u(e: &String) -> &str {&*e}
2020
| ^^^^ not FFI-safe
2121
|
2222
= help: consider using `*const u8` and a length instead
2323
= note: this reference to an unsized type contains metadata, which makes it incompatible with a C pointer
2424
note: the lint level is defined here
25-
--> $DIR/allow_improper_ctypes.rs:1:26
25+
--> $DIR/allow-improper-ctypes.rs:1:26
2626
|
2727
LL | #![deny(improper_ctypes, improper_c_fn_definitions)]
2828
| ^^^^^^^^^^^^^^^^^^^^^^^^^
2929

3030
error: `extern` fn uses type `UnsafeStruct`, which is not FFI-safe
31-
--> $DIR/allow_improper_ctypes.rs:81:23
31+
--> $DIR/allow-improper-ctypes.rs:81:23
3232
|
3333
LL | extern "C" fn fn2u(e: UnsafeStruct) {}
3434
| ^^^^^^^^^^^^ not FFI-safe
3535
|
3636
= note: this struct/enum/union (`UnsafeStruct`) is FFI-unsafe due to a `String` field
3737
note: the type is defined here
38-
--> $DIR/allow_improper_ctypes.rs:18:1
38+
--> $DIR/allow-improper-ctypes.rs:18:1
3939
|
4040
LL | struct UnsafeStruct (String);
4141
| ^^^^^^^^^^^^^^^^^^^
4242
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `String`
4343
= note: `String` has unspecified layout
4444

4545
error: `extern` fn uses type `ext_crate::UnsafeStruct`, which is not FFI-safe
46-
--> $DIR/allow_improper_ctypes.rs:85:24
46+
--> $DIR/allow-improper-ctypes.rs:85:24
4747
|
4848
LL | extern "C" fn fn2ou(e: ext_crate::UnsafeStruct) {}
4949
| ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -53,22 +53,22 @@ LL | extern "C" fn fn2ou(e: ext_crate::UnsafeStruct) {}
5353
= note: `String` has unspecified layout
5454

5555
error: `extern` fn uses type `AllowedUnsafeStruct`, which is not FFI-safe
56-
--> $DIR/allow_improper_ctypes.rs:90:23
56+
--> $DIR/allow-improper-ctypes.rs:90:23
5757
|
5858
LL | extern "C" fn fn3u(e: AllowedUnsafeStruct) {}
5959
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
6060
|
6161
= note: this struct/enum/union (`AllowedUnsafeStruct`) is FFI-unsafe due to a `String` field
6262
note: the type is defined here
63-
--> $DIR/allow_improper_ctypes.rs:22:1
63+
--> $DIR/allow-improper-ctypes.rs:22:1
6464
|
6565
LL | struct AllowedUnsafeStruct (String);
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
6767
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `String`
6868
= note: `String` has unspecified layout
6969

7070
error: `extern` fn uses type `ext_crate::AllowedUnsafeStruct`, which is not FFI-safe
71-
--> $DIR/allow_improper_ctypes.rs:95:24
71+
--> $DIR/allow-improper-ctypes.rs:95:24
7272
|
7373
LL | extern "C" fn fn3ou(e: ext_crate::AllowedUnsafeStruct) {}
7474
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -78,7 +78,7 @@ LL | extern "C" fn fn3ou(e: ext_crate::AllowedUnsafeStruct) {}
7878
= note: `String` has unspecified layout
7979

8080
error: `extern` callback uses type `&[A]`, which is not FFI-safe
81-
--> $DIR/allow_improper_ctypes.rs:139:14
81+
--> $DIR/allow-improper-ctypes.rs:139:14
8282
|
8383
LL | combine: extern "C" fn(&[A]) -> A,
8484
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -88,15 +88,15 @@ LL | combine: extern "C" fn(&[A]) -> A,
8888
= note: this reference to an unsized type contains metadata, which makes it incompatible with a C pointer
8989

9090
error: `extern` callback uses type `FakeVTable<u32>`, which is not FFI-safe
91-
--> $DIR/allow_improper_ctypes.rs:145:24
91+
--> $DIR/allow-improper-ctypes.rs:145:24
9292
|
9393
LL | type FakeVTableMaker = extern "C" fn() -> FakeVTable<u32>;
9494
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
9595
|
9696
= note: the function pointer to `extern "C" fn() -> FakeVTable<u32>` is FFI-unsafe due to `FakeVTable<u32>`
9797
= note: this struct/enum/union (`FakeVTable<u32>`) is FFI-unsafe due to a `(u32, usize)` field
9898
note: the type is defined here
99-
--> $DIR/allow_improper_ctypes.rs:137:1
99+
--> $DIR/allow-improper-ctypes.rs:137:1
100100
|
101101
LL | struct FakeVTable<A>{
102102
| ^^^^^^^^^^^^^^^^^^^^
File renamed without changes.
File renamed without changes.

tests/ui/lint/improper_ctypes/lint-94223.rs renamed to tests/ui/lint/improper-ctypes/ice-fnptr-slicearg.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#![crate_type = "lib"]
22
#![deny(improper_c_fn_definitions, improper_c_callbacks)]
33

4+
// Issue: https://github.com/rust-lang/rust/issues/94223
5+
// ice when a FnPtr has an unsized array argument
6+
47
pub fn bad(f: extern "C" fn([u8])) {}
58
//~^ ERROR `extern` callback uses type `[u8]`, which is not FFI-safe
69

tests/ui/lint/improper_ctypes/lint-94223.stderr renamed to tests/ui/lint/improper-ctypes/ice-fnptr-slicearg.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `extern` callback uses type `[u8]`, which is not FFI-safe
2-
--> $DIR/lint-94223.rs:4:15
2+
--> $DIR/ice-fnptr-slicearg.rs:7:15
33
|
44
LL | pub fn bad(f: extern "C" fn([u8])) {}
55
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -8,13 +8,13 @@ LL | pub fn bad(f: extern "C" fn([u8])) {}
88
= help: consider using a raw pointer to the slice's first element (and a length) instead
99
= note: slices have no C equivalent
1010
note: the lint level is defined here
11-
--> $DIR/lint-94223.rs:2:36
11+
--> $DIR/ice-fnptr-slicearg.rs:2:36
1212
|
1313
LL | #![deny(improper_c_fn_definitions, improper_c_callbacks)]
1414
| ^^^^^^^^^^^^^^^^^^^^
1515

1616
error: `extern` callback uses type `[u8]`, which is not FFI-safe
17-
--> $DIR/lint-94223.rs:7:28
17+
--> $DIR/ice-fnptr-slicearg.rs:10:28
1818
|
1919
LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
2020
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -24,7 +24,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
2424
= note: slices have no C equivalent
2525

2626
error: `extern` callback uses type `[u8]`, which is not FFI-safe
27-
--> $DIR/lint-94223.rs:7:49
27+
--> $DIR/ice-fnptr-slicearg.rs:10:49
2828
|
2929
LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
3030
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -34,7 +34,7 @@ LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
3434
= note: slices have no C equivalent
3535

3636
error: `extern` callback uses type `[u8]`, which is not FFI-safe
37-
--> $DIR/lint-94223.rs:11:18
37+
--> $DIR/ice-fnptr-slicearg.rs:14:18
3838
|
3939
LL | struct BadStruct(extern "C" fn([u8]));
4040
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -44,7 +44,7 @@ LL | struct BadStruct(extern "C" fn([u8]));
4444
= note: slices have no C equivalent
4545

4646
error: `extern` callback uses type `[u8]`, which is not FFI-safe
47-
--> $DIR/lint-94223.rs:15:7
47+
--> $DIR/ice-fnptr-slicearg.rs:18:7
4848
|
4949
LL | A(extern "C" fn([u8])),
5050
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -54,7 +54,7 @@ LL | A(extern "C" fn([u8])),
5454
= note: slices have no C equivalent
5555

5656
error: `extern` callback uses type `[u8]`, which is not FFI-safe
57-
--> $DIR/lint-94223.rs:20:7
57+
--> $DIR/ice-fnptr-slicearg.rs:23:7
5858
|
5959
LL | A(extern "C" fn([u8])),
6060
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -64,7 +64,7 @@ LL | A(extern "C" fn([u8])),
6464
= note: slices have no C equivalent
6565

6666
error: `extern` callback uses type `[u8]`, which is not FFI-safe
67-
--> $DIR/lint-94223.rs:24:12
67+
--> $DIR/ice-fnptr-slicearg.rs:27:12
6868
|
6969
LL | type Foo = extern "C" fn([u8]);
7070
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -74,7 +74,7 @@ LL | type Foo = extern "C" fn([u8]);
7474
= note: slices have no C equivalent
7575

7676
error: `extern` callback uses type `Option<&<T as FooTrait>::FooType>`, which is not FFI-safe
77-
--> $DIR/lint-94223.rs:31:20
77+
--> $DIR/ice-fnptr-slicearg.rs:34:20
7878
|
7979
LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
8080
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -84,7 +84,7 @@ LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
8484
= note: enum has no representation hint
8585

8686
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
87-
--> $DIR/lint-94223.rs:41:17
87+
--> $DIR/ice-fnptr-slicearg.rs:44:17
8888
|
8989
LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
9090
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -93,13 +93,13 @@ LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
9393
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
9494
= note: `FfiUnsafe` has unspecified layout
9595
note: the type is defined here
96-
--> $DIR/lint-94223.rs:34:1
96+
--> $DIR/ice-fnptr-slicearg.rs:37:1
9797
|
9898
LL | pub struct FfiUnsafe;
9999
| ^^^^^^^^^^^^^^^^^^^^
100100

101101
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
102-
--> $DIR/lint-94223.rs:44:30
102+
--> $DIR/ice-fnptr-slicearg.rs:47:30
103103
|
104104
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
105105
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -108,13 +108,13 @@ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUns
108108
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
109109
= note: `FfiUnsafe` has unspecified layout
110110
note: the type is defined here
111-
--> $DIR/lint-94223.rs:34:1
111+
--> $DIR/ice-fnptr-slicearg.rs:37:1
112112
|
113113
LL | pub struct FfiUnsafe;
114114
| ^^^^^^^^^^^^^^^^^^^^
115115

116116
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
117-
--> $DIR/lint-94223.rs:44:56
117+
--> $DIR/ice-fnptr-slicearg.rs:47:56
118118
|
119119
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
120120
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -123,13 +123,13 @@ LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUns
123123
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
124124
= note: `FfiUnsafe` has unspecified layout
125125
note: the type is defined here
126-
--> $DIR/lint-94223.rs:34:1
126+
--> $DIR/ice-fnptr-slicearg.rs:37:1
127127
|
128128
LL | pub struct FfiUnsafe;
129129
| ^^^^^^^^^^^^^^^^^^^^
130130

131131
error: `extern` callback uses type `FfiUnsafe`, which is not FFI-safe
132-
--> $DIR/lint-94223.rs:48:22
132+
--> $DIR/ice-fnptr-slicearg.rs:51:22
133133
|
134134
LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -138,7 +138,7 @@ LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
138138
= help: consider adding a `#[repr(C)]` (not `#[repr(C,packed)]`) or `#[repr(transparent)]` attribute to `FfiUnsafe`
139139
= note: `FfiUnsafe` has unspecified layout
140140
note: the type is defined here
141-
--> $DIR/lint-94223.rs:34:1
141+
--> $DIR/ice-fnptr-slicearg.rs:37:1
142142
|
143143
LL | pub struct FfiUnsafe;
144144
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/lint/improper_ctypes/mustpass-73249-1.rs renamed to tests/ui/lint/improper-ctypes/ice-fully-normalize-1.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ check-pass
22
#![deny(improper_ctypes)]
33

4+
// Issue: https://github.com/rust-lang/rust/issues/73249
5+
// "ICE: could not fully normalize"
6+
47
pub trait Foo {
58
type Assoc: 'static;
69
}

tests/ui/lint/improper_ctypes/lint-73249-2.rs renamed to tests/ui/lint/improper-ctypes/ice-fully-normalize-2.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#![feature(type_alias_impl_trait)]
44
#![deny(improper_ctypes)]
55

6+
// Issue: https://github.com/rust-lang/rust/issues/73249
7+
// "ICE: could not fully normalize"
8+
69
trait Baz {}
710

811
impl Baz for () {}

tests/ui/lint/improper_ctypes/lint-73249-3.rs renamed to tests/ui/lint/improper-ctypes/ice-fully-normalize-3.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#![feature(type_alias_impl_trait)]
22
#![deny(improper_ctypes)]
33

4+
// Issue: https://github.com/rust-lang/rust/issues/73249
5+
// "ICE: could not fully normalize"
6+
47
pub trait Baz {}
58

69
impl Baz for u32 {}

tests/ui/lint/improper_ctypes/lint-73249-5.stderr renamed to tests/ui/lint/improper-ctypes/ice-fully-normalize-3.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error: `extern` block uses type `A`, which is not FFI-safe
2-
--> $DIR/lint-73249-5.rs:21:25
2+
--> $DIR/ice-fully-normalize-3.rs:24:25
33
|
44
LL | pub fn lint_me() -> A;
55
| ^ not FFI-safe
66
|
77
= note: this struct/enum/union (`A`) is FFI-unsafe due to a `Qux` field
88
note: the type is defined here
9-
--> $DIR/lint-73249-5.rs:16:1
9+
--> $DIR/ice-fully-normalize-3.rs:19:1
1010
|
1111
LL | pub struct A {
1212
| ^^^^^^^^^^^^
1313
= note: opaque types have no C equivalent
1414
note: the lint level is defined here
15-
--> $DIR/lint-73249-5.rs:2:9
15+
--> $DIR/ice-fully-normalize-3.rs:2:9
1616
|
1717
LL | #![deny(improper_ctypes)]
1818
| ^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)