improve panic message for slice windows and chunks#107442
improve panic message for slice windows and chunks#107442bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @cuviper (rustbot has picked a reviewer for you, use r? to override) |
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
1b5bc22 to
f758ec0
Compare
|
Bringing my 2 cents: |
|
@albertlarsan68: there are unstable/nightly-only APIs like |
That's #99471.
It's probably possible to create a lint similar to |
Sure, but only for situations where the runtime size can be const-folded and evaluated to be 0 at compile-time. |
|
I think It's also clear to say just "chunk size" or "window size", rather than mixing up windows/chunks/rchunks variants. |
f758ec0 to
de1200d
Compare
|
I've updated the wording to "chunk size must be non-zero" everywhere and use |
cuviper
left a comment
There was a problem hiding this comment.
Windows are different than chunks. :)
073bd3d to
2fbe927
Compare
|
Sorry, I thought that was what you meant by #107442 (comment). I changed window back now. |
|
Ah, I only meant that "window/chunk size" should be the subject, rather than "windows/chunks" (the methods) as the subject having a size. Anyway, looks good now! @bors r+ |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#107389 (Fixing confusion between mod and remainder) - rust-lang#107442 (improve panic message for slice windows and chunks) - rust-lang#107470 (Small bootstrap improvements) - rust-lang#107487 (Make the "extra if in let...else block" hint a suggestion) - rust-lang#107499 (Do not depend on Generator trait when deducing closure signature) - rust-lang#107533 (Extend `-Z print-type-sizes` to distinguish generator upvars+locals from "normal" fields.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
before:
after:
fixes #107437