Open
Description
Basically, it'd be nice to have a lint which checks unsafe code dealing with pointers that indexes them (either by from_raw_parts(...)
or *ptr.offset(...)
) which doesn't specifically special-case zero-sized types.
This could probably simplified to checking that functions that perform said indexing don't contain any mentions of mem::size_of
or similar.
The main idea is that this would lint custom data structures similar to Vec
and co. that will not work with zero-sized types. Obviously not a lint that I'd expect to come up very often, but people working in embedded code might run into a problem like this and it's good to point it out and require an #[allow(...)]
that acknowledges the risks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment