Warn about read into zero-length Vec#8964
Merged
Merged
Conversation
|
r? @dswij (rust-highfive has picked a reviewer for you, use r? to override) |
23e1ff5 to
34b42f4
Compare
dswij
approved these changes
Jun 12, 2022
Member
dswij
left a comment
There was a problem hiding this comment.
Thanks for the PR! Changes looks great with the tests
Can you help to squash some commits? After that, I think it's good to merge
34b42f4 to
2b84657
Compare
2b84657 to
14478bb
Compare
Contributor
Author
|
@dswij |
Member
|
Thanks for this! @bors r+ |
Contributor
|
📌 Commit 14478bb has been approved by |
Contributor
Contributor
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This was referenced Jun 15, 2022
Merged
|
@tamaroning let mut v = Vec::new();
{
v.resize(10, 0);
r.read(&mut v).unwrap();
}will cause this lint to go off. |
Member
|
@unrealhoang Seems like this is because the lint does not transverse down scopes. Can you help to create a new issue for this? |
Member
|
@unrealhoang Thanks for this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8886
.stderrfile)cargo testpasses locallycargo dev update_lintscargo dev fmtchangelog: none