]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #107442 - lukas-code:slice-panics, r=cuviper
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 1 Feb 2023 04:54:38 +0000 (05:54 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 04:54:38 +0000 (05:54 +0100)
improve panic message for slice windows and chunks

before:
```text
thread 'main' panicked at 'size is zero', /rustc/1e225413a21fa69570bd3fefea9eb05e33f8b917/library/core/src/slice/mod.rs:809:44
```
```text
thread 'main' panicked at 'assertion failed: `(left != right)`
  left: `0`,
 right: `0`: chunks cannot have a size of zero', /rustc/1e225413a21fa69570bd3fefea9eb05e33f8b917/library/core/src/slice/mod.rs:843:9
```

after:
```text
thread 'main' panicked at 'chunk size must be non-zero', src/main.rs:4:22
```

fixes https://github.com/rust-lang/rust/issues/107437


Trivial merge