Skip to content

Commit f614086

Browse files
committed
ImproperCTypes: rename lint files
1 parent 96fc1f6 commit f614086

24 files changed

+81
-35
lines changed

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
| ^^^^^^^^^^^^^^^

tests/ui/lint/improper_ctypes/mustpass-73249-4.rs renamed to tests/ui/lint/improper_ctypes/ice-fully-normalize-4.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
use std::marker::PhantomData;
58

69
trait Foo {

tests/ui/lint/improper_ctypes/lint-73249-5.rs renamed to tests/ui/lint/improper_ctypes/ice-fully-normalize-5.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-3.stderr renamed to tests/ui/lint/improper_ctypes/ice-fully-normalize-5.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-3.rs:21:25
2+
--> $DIR/ice-fully-normalize-5.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-3.rs:16:1
9+
--> $DIR/ice-fully-normalize-5.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-3.rs:2:9
15+
--> $DIR/ice-fully-normalize-5.rs:2:9
1616
|
1717
LL | #![deny(improper_ctypes)]
1818
| ^^^^^^^^^^^^^^^

tests/ui/lint/improper_ctypes/mustpass-73249.rs renamed to tests/ui/lint/improper_ctypes/ice-fully-normalize.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;
69
}

0 commit comments

Comments
 (0)