-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Warn about read into zero-length Vec
#8964
Conversation
r? @dswij (rust-highfive has picked a reviewer for you, use r? to override) |
23e1ff5
to
34b42f4
Compare
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 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
@dswij |
Thanks for this! @bors r+ |
📌 Commit 14478bb has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
@tamaroning let mut v = Vec::new();
{
v.resize(10, 0);
r.read(&mut v).unwrap();
} will cause this lint to go off. |
@unrealhoang Seems like this is because the lint does not transverse down scopes. Can you help to create a new issue for this? |
@unrealhoang Thanks for this! |
Closes #8886
.stderr
file)cargo test
passes locallycargo dev update_lints
cargo dev fmt
changelog: none