]> git.lizzy.rs Git - rust.git/commit - compiler/rustc_parse/src/parser/ty.rs
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)
commit1dbb5efff35b98f8e11dab87d0a98136e6cf9390
tree14b5183f7a04558ee9e54ecdf703dd13f4069f91
parent0d2ab6774243451c8743bad2c9dbdf2e61d10f89
parent2fbe9274aae88709cb7aefada157c47e4232e2eb
Rollup merge of #107442 - lukas-code:slice-panics, r=cuviper

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