Skip to content

Commit 59de843

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 5382587 commit 59de843

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

+82
-36
lines changed
File renamed without changes.
File renamed without changes.
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)