about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-17 15:14:11 +0000
committerbors <bors@rust-lang.org>2024-01-17 15:14:11 +0000
commite27ebf28e78f9b7db49dd82dc638e10c80282cda (patch)
tree76cdd3a048ff2073fa11428ae71a719472af480a /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent5f3a06023aae5e7202381855fb30c7d759bd30a6 (diff)
parent8c79f7840d399e3de52c63b1951a46adf6dda515 (diff)
downloadrust-e27ebf28e78f9b7db49dd82dc638e10c80282cda.tar.gz
rust-e27ebf28e78f9b7db49dd82dc638e10c80282cda.zip
Auto merge of #11766 - dswij:issue-9274, r=blyxyas
`read_zero_byte_vec` refactor for better heuristics

Fixes #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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions