diff options
| author | bors <bors@rust-lang.org> | 2023-11-24 12:18:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-24 12:18:11 +0000 |
| commit | 96eab0655fc5afee4d93db05bed7126160c35254 (patch) | |
| tree | de45a1f71c4e7690b254193cdfd332ab8b12a689 /tests/rustdoc-js-std/full-path-function.js | |
| parent | c3243f99426683ba14deb27279af2553e8a18714 (diff) | |
| parent | 553857bb2b7c4fa79f342d3797f421121d87e9d1 (diff) | |
| download | rust-96eab0655fc5afee4d93db05bed7126160c35254.tar.gz rust-96eab0655fc5afee4d93db05bed7126160c35254.zip | |
Auto merge of #11859 - y21:issue11856, r=blyxyas
[`missing_asserts_for_indexing`]: work with bodies instead of blocks separately
Fixes #11856
Before this change, this lint would check blocks independently of each other, which means that it misses `assert!()`s from parent blocks.
```rs
// check_block
assert!(x.len() > 1);
{
// check_block
// no assert here
let _ = x[0] + x[1];
}
```
This PR changes it to work with bodies rather than individual blocks. That means that a function will be checked in one go and we can remember if an `assert!` occurred anywhere.
Eventually it would be nice to have a more control flow-aware analysis, possibly by rewriting it as a MIR lint, but that's more complicated and I wanted this fixed first.
changelog: [`missing_asserts_for_indexing`]: accept `assert!`s from parent blocks
Diffstat (limited to 'tests/rustdoc-js-std/full-path-function.js')
0 files changed, 0 insertions, 0 deletions
