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
fix(ptr_as_ptr): handle std::ptr::null{_mut}
#11913
fix(ptr_as_ptr): handle std::ptr::null{_mut}
#11913
Conversation
r? @llogiq (rustbot has picked a reviewer for you, use r? to override) |
std::ptr::null{_mut}
std::ptr::null{_mut}
close rust-lang#11066 close rust-lang#11665 close rust-lang#11911
2e0afcf
to
8eea8b1
Compare
I've rebased onto latest master. |
enum OmitFollowedCastReason<'a> { | ||
None, | ||
Null(&'a QPath<'a>), | ||
NullMut(&'a QPath<'a>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for future improvement:
This should be replaced with check of:
- if calling function is
<T>(...args) -> *{const,mut} T
- one of:
args
does not contain or referT
-> we can give arbitraryT
- check if it still pass type-checking if we change
T=Src
toT=Dst
Does this also work for stuff like |
This looks like a solid improvement to me. Any further work can be done in a follow-up PR. @bors r+ |
💔 Test failed - checks-action_test |
That's a weird one; doesn't seem like it has to do with this PR. Let's see if other PRs also fail. |
@bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
close #11066
close #11665
close #11911
Please write a short comment explaining your change (or "none" for internal only changes)
changelog: [
ptr_as_ptr
]: handlestd::ptr::null
andstd::ptr::null_mut