-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Suggest std::ptr::null if literal 0 is given to a raw pointer function argument #107553
Suggest std::ptr::null if literal 0 is given to a raw pointer function argument #107553
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
ea646ea
to
ff9415a
Compare
Changes:
|
ff9415a
to
cce8a76
Compare
|
The diagnostic fires for raw pointers no matter the type behind it. |
Yeah, I think the commit name is better, let me update the PR name to better reflect the changes. Sorry for the confusion. |
cce8a76
to
3296729
Compare
Changes:
|
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.
Thanks!
@bors r+ |
Rollup of 5 pull requests Successful merges: - rust-lang#107553 (Suggest std::ptr::null if literal 0 is given to a raw pointer function argument) - rust-lang#107580 (Recover from lifetimes with default lifetimes in generic args) - rust-lang#107669 (rustdoc: combine duplicate rules in ayu CSS) - rust-lang#107685 (Suggest adding a return type for async functions) - rust-lang#107687 (Adapt SROA MIR opt for aggregated MIR) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Implementation feels a little sus (we're parsing the span for a
0
) but it seems to fall in line the string-expected-found-char condition right above this check, so I think it's fine.Feedback appreciated on help text? I think it's consistent but it does sound a little awkward maybe?
Fixes #107517