-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Suggest ptr::null, ptr::null_mut over casting. #1047
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
Comments
These are also in |
This could be done for a lot a paths in suggestions. |
Sounds like we could use a utility function that walks the parent chain to look for |
You don't even need to walk the parent chain, the current crate is available as |
True. I had forgotten that this attribute is crate-level only. |
I'm happy to give this a shot. |
Great! Feel free to ask if you have any question. |
This fixes #1047. I did not bother to add a full suggestion, because replacing with `std::ptr::null()` may still lead to inference failures.
Add a lint to suggest converting all instances of:
To:
See rust-lang/rust#34456
The text was updated successfully, but these errors were encountered: