rust/tests
bors 8d5d9e0103 Auto merge of #8250 - pr2502:fix_repeat_underflow, r=giraffate
Fix underflow in `manual_split_once` lint

Hi, a friend found clippy started crashing on a suspiciously large allocation of `u64::MAX` memory on their code.

The mostly minimized repro is:
```rust
fn _f01(title: &str) -> Option<()> {
    let _ = title[1..].splitn(2, '[').next()?;
    Some(())
}
```

The underflow happens in this case on line 57 of the patch but I've changed the other substraction to saturating as well since it could potentially cause the same issue.

I'm not sure where to put a regression test, or if it's even worth for such a thing.

Aside, has it been considered before to build clippy with overflow checks enabled?

changelog: fix ICE of underflow in `manual_split_once` lint
2022-01-28 13:31:51 +00:00
..
test_utils Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup 2022-01-13 13:18:19 +01:00
ui Auto merge of #8250 - pr2502:fix_repeat_underflow, r=giraffate 2022-01-28 13:31:51 +00:00
ui_test
ui-cargo
ui-internal Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup 2022-01-13 13:18:19 +01:00
ui-toml Track msrv attribute for manual_bits and borrow_as_prt 2022-01-15 00:57:43 +01:00
workspace_test Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup 2022-01-13 13:18:19 +01:00
clippy.toml
compile-test.rs Remove __CLIPPY_INTERNAL_TESTS env var 2022-01-17 12:37:05 -06:00
dogfood.rs Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup 2022-01-13 13:18:19 +01:00
fmt.rs Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup 2022-01-13 13:18:19 +01:00
integration.rs
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs
workspace.rs Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup 2022-01-13 13:18:19 +01:00