-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove raw_pointer_deriving lint #14615
Comments
+1 |
I think that each derivation can emit a more specific warning when it handles a raw pointer in a possibly unexpected way (for example, Eq or Ord can say "ignoring raw pointer field" |
I'm not in favour of removing it... how many instances of Also, this is a safety problem, e.g. a derived |
Worth pointing out that |
Most of them, if you understand raw pointers to be plain old data. For example, a struct which wraps an FFI object could
People hit it all the time and get confused on IRC because it's warning them that they're getting exactly the behavior they expect. We have the lint disabled in 5 Servo modules, as well.
But they aren't ignored, they're just treated as plain old data, which (to me anyway) is the only thing you might possibly expect. People should know that raw pointers may be NULL, may point to structures whose layout/size is not known in Rust, and can't be dereferenced willy-nilly from safe code. If you're confused on that then you need to read the unsafe programming chapter, not a single lint message. |
|
Also, this can probably be closed, because #29882 already landed. |
- Bumped to 0.10.0 - Removed `allow(raw_pointer_derive)`, see discussion rust-lang/rust#14615
After examination, it doesn't appear that deriving raw pointers presents any kind of safety problem (no derivings dereference unsafe pointers). Most people seem to believe that the original justification presented in #13032 isn't sufficient.
The text was updated successfully, but these errors were encountered: