You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…entri3
move `read_zero_byte_vec` to nursery
I think the concerns in rust-lang#9274 are valid, and we should move this to nursery while we're reworking this.
changelog: [`read_zero_byte_vec`] moved to nursery
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jan 25, 2024
`read_zero_byte_vec` refactor for better heuristics
Fixesrust-lang#9274
Previously, the implementation of `read_zero_byte_vec` only checks for the next statement after the vec init. This fails when there is a block with statements that are expanded and walked by the old visitor.
This PR refactors so that:
1. It checks if there is a `resize` on the vec
2. It works on blocks properly
e.g. This should properly lint now:
```
let mut v = Vec::new();
{
f.read(&mut v)?;
//~^ ERROR: reading zero byte data to `Vec`
}
```
changelog: [`read_zero_byte_vec`] Refactored for better heuristics
Rather unideal, see if it can be improved.
From emberian/rustdoc_ng#31
The text was updated successfully, but these errors were encountered: