-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add new lint might_panic
#11889
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
Add new lint might_panic
#11889
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @xFrednet (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
ce52300
to
6dfc169
Compare
☔ The latest upstream changes (presumably #11597) made this pull request unmergeable. Please resolve the merge conflicts. |
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
fix tests which are affected by `might-panic`
Hey @cocodery, I think you can leave this PR until the discussion in the issue has been solved. If you rebase now, it's likely to be broken again, by the time we came to a conclusion. You can maybe pickup another issue, with the |
Hi, thanks for your advice! I'll waiting for you conclusion. |
I'm closing this PR due to the reasons stated in the issue. @cocodery Thank you for trying to implement this issue! If you have any questions, you're welcome to reach out. |
fixes #issue11808
This lint check accessing array or slice with index but don't know whether this index is legal.
For example, the code
can be written as
Besides, if you declare
my_number
with its typei32
,it can be written as
This lint can help programmer to locate where you access array out of boundary easilier, and can write their handler.
changelog: add new lint
might_panic