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
.. ranges are [inclusive, exclusive) and index access is normally bounds checked, e.g. slice[slice.len()+100..] or slice[slice.len()] panics, however slice[slice.len()..]/slice[slice.len()..slice.len()] is an exception, it just returns an empty slice despite the first inclusive index being out of bounds.
I agree this is convenient and I guess this was implemented intentionally, and we can't silently break this now, but it at least needs to be 1) documented as intentional behavior, 2) tested as intentional behavior.
So far I haven't found neither documentation, nor tests, nor design rationale in the range indexing RFCs and their implementations.