Skip to content

Commit 0c0e764

Browse files
committed
ImproperCTypes: move code and tests into proper directories
1 parent 0d0f4ea commit 0c0e764

40 files changed

+959
-949
lines changed

compiler/rustc_lint/src/types.rs

Lines changed: 10 additions & 857 deletions
Large diffs are not rendered by default.

compiler/rustc_lint/src/types/improper_ctypes.rs

Lines changed: 859 additions & 2 deletions
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.

tests/ui/lint/lint-ctypes-113436-1.stderr renamed to tests/ui/lint/improper-ctypes/lint-113436-1.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
error: `extern` fn uses type `NotSafe`, which is not FFI-safe
2-
--> $DIR/lint-ctypes-113436-1.rs:22:22
2+
--> $DIR/lint-113436-1.rs:22:22
33
|
44
LL | extern "C" fn bar(x: Bar) -> Bar {
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/lint-ctypes-113436-1.rs:13:1
10+
--> $DIR/lint-113436-1.rs:13:1
1111
|
1212
LL | struct NotSafe(u32);
1313
| ^^^^^^^^^^^^^^
1414
note: the lint level is defined here
15-
--> $DIR/lint-ctypes-113436-1.rs:1:9
15+
--> $DIR/lint-113436-1.rs:1:9
1616
|
1717
LL | #![deny(improper_ctypes_definitions)]
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919

2020
error: `extern` fn uses type `NotSafe`, which is not FFI-safe
21-
--> $DIR/lint-ctypes-113436-1.rs:22:30
21+
--> $DIR/lint-113436-1.rs:22:30
2222
|
2323
LL | extern "C" fn bar(x: Bar) -> Bar {
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/lint-ctypes-113436-1.rs:13:1
29+
--> $DIR/lint-113436-1.rs:13:1
3030
|
3131
LL | struct NotSafe(u32);
3232
| ^^^^^^^^^^^^^^
File renamed without changes.

tests/ui/lint/lint-ctypes-73249-2.stderr renamed to tests/ui/lint/improper-ctypes/lint-73249-2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: `extern` block uses type `Qux`, which is not FFI-safe
2-
--> $DIR/lint-ctypes-73249-2.rs:27:21
2+
--> $DIR/lint-73249-2.rs:27:21
33
|
44
LL | fn lint_me() -> A<()>;
55
| ^^^^^ not FFI-safe
66
|
77
= note: opaque types have no C equivalent
88
note: the lint level is defined here
9-
--> $DIR/lint-ctypes-73249-2.rs:2:9
9+
--> $DIR/lint-73249-2.rs:2:9
1010
|
1111
LL | #![deny(improper_ctypes)]
1212
| ^^^^^^^^^^^^^^^
File renamed without changes.

tests/ui/lint/lint-ctypes-73249-5.stderr renamed to tests/ui/lint/improper-ctypes/lint-73249-3.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: `extern` block uses type `Qux`, which is not FFI-safe
2-
--> $DIR/lint-ctypes-73249-5.rs:21:25
2+
--> $DIR/lint-73249-3.rs:21:25
33
|
44
LL | pub fn lint_me() -> A;
55
| ^ not FFI-safe
66
|
77
= note: opaque types have no C equivalent
88
note: the lint level is defined here
9-
--> $DIR/lint-ctypes-73249-5.rs:2:9
9+
--> $DIR/lint-73249-3.rs:2:9
1010
|
1111
LL | #![deny(improper_ctypes)]
1212
| ^^^^^^^^^^^^^^^
File renamed without changes.

0 commit comments

Comments
 (0)