Files
rust/compiler
David Wood 7744a86963 lint/ctypes: stricter () return type checks
`()` 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 an 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 a unit return type or a transparent
wrapper around a unit is checked for directly for functions and fn-ptrs.

Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit f53cef31f5)
2023-08-11 18:41:21 -07:00
..
2023-07-06 13:04:13 +00:00
2023-05-02 10:45:16 -07:00
2023-06-28 10:52:48 +08:00
2023-07-02 21:02:31 +02:00
2023-06-11 22:45:04 -04:00
2023-07-02 21:02:31 +02:00
2023-07-02 21:02:31 +02:00
2023-04-10 22:02:52 +02:00
2023-07-03 13:51:54 -07:00