Files
rust/tests/ui
bors 601a34de8c Auto merge of #113457 - davidtwco:lint-ctypes-issue-113436, r=oli-obk
lint/ctypes: fix `()` return type checks

Fixes #113436.

`()` is normally FFI-unsafe, but is FFI-safe when used as a return type. It is also desirable that a transparent newtype for `()` is FFI-safe when used as a return type.

In order to support this, when a type was deemed FFI-unsafe, because of a `()` type, and was used in return type - then the type was considered  FFI-safe. However, this was the wrong approach - it didn't check that the `()` was part of a transparent newtype! The consequence of this is that the presence of a `()` type in a more complex return type would make it the entire type be considered safe (as long as the `()` type was the first that the lint found) - which is obviously incorrect.

Instead, this logic is removed, and after [consultation with t-lang](https://github.com/rust-lang/rust/issues/113436#issuecomment-1640756721), I've fixed the bugs and inconsistencies and  made `()` FFI-safe within types.

I also refactor a function, but that's not too exciting.
2023-07-26 15:27:36 +00:00
..
2023-07-24 18:04:35 +02:00
2023-01-30 20:12:19 +00:00
2023-05-24 19:35:59 -03:00
2023-05-30 13:03:40 +02:00
2023-07-25 14:30:58 +02:00
2023-05-08 17:58:01 -03:00
2023-07-03 09:12:15 +02:00
2023-01-30 20:12:19 +00:00
2023-06-10 14:46:11 -04:00
2023-07-10 20:09:28 +00:00
2023-04-29 13:01:46 +01:00
2023-07-01 02:28:15 -04:00
2023-07-11 17:52:43 +08:00
2023-06-29 16:24:07 +03:00
2023-06-26 08:56:32 +00:00
2023-07-23 10:09:43 +00:00
2023-04-03 09:24:11 +02:00
2023-04-19 19:13:45 +00:00
2023-04-13 22:10:26 -05:00
2023-06-20 19:46:01 -04:00
2023-05-08 03:36:30 +00:00
2023-05-29 12:07:41 -03:00
2023-03-29 18:04:44 -04:00
2023-04-26 21:02:56 +02:00
2023-06-12 20:24:48 +08:00
2023-04-29 13:01:46 +01:00
2023-05-12 00:10:52 +00:00
2023-01-15 19:46:20 +00:00
2023-01-15 19:46:20 +00:00
2023-03-08 00:00:18 +00:00
2023-04-13 22:10:26 -05:00
2023-04-13 22:10:26 -05:00
2023-03-08 00:00:18 +00:00
2023-03-08 00:00:18 +00:00