You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mgeier opened this issue
Aug 11, 2020
· 1 comment
· Fixed by #75499
Labels
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
You're right, I guess it's a copy/paste error from RangeToInclusive in #57604? We're happy to see a PR to fix it :)
JohnTitor
added
C-bug
Category: This is a bug.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
labels
Aug 13, 2020
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
https://doc.rust-lang.org/std/slice/trait.SliceIndex.html#impl-SliceIndex%3Cstr%3E mentions "Panics [...] if begin > end, or if end > len", which I think is correct.
However, https://doc.rust-lang.org/std/slice/trait.SliceIndex.html#impl-SliceIndex%3Cstr%3E-1 mentions "Panics [...] if begin >= len", which I think is wrong, isn't it?
Shouldn't this be "Panics [...] if begin > len"?
The current stable compiler doesn't seem to create a panicking program when I use "begin = len".
The documentation for slice slicing doesn't mention anything at all: https://doc.rust-lang.org/std/slice/trait.SliceIndex.html#impl-SliceIndex%3C%5BT%5D%3E-2.
It would be great to have the (correct) description there as well.
I think this has already been fixed in #32099 and #32183 (more than 4 years ago), but it seems to have gotten lost again since then?
Or am I missing something?
The text was updated successfully, but these errors were encountered: