]> git.lizzy.rs Git - rust.git/commit
Use more specific panic message for &str slicing errors
authorUlrik Sverdrup <bluss@users.noreply.github.com>
Tue, 29 Nov 2016 03:11:12 +0000 (04:11 +0100)
committerUlrik Sverdrup <bluss@users.noreply.github.com>
Wed, 30 Nov 2016 17:59:58 +0000 (18:59 +0100)
commitd83fff3b3b9dd0fd6eef862e97f883d171367041
treeab91da72cf2f86842144be21115ad9a3787dd57e
parent127a83df6615d09cda6ed9b53f7daba2d78c925d
Use more specific panic message for &str slicing errors

Separate out of bounds errors from character boundary errors, and print
more details for character boundary errors.

Example:

    &"abcαβγ"[..4]

    thread 'str::test_slice_fail_boundary_1' panicked at 'byte index 4 is not
    a char boundary; it is inside `α` (bytes 3..5) of `abcαβγ`'
src/doc/book/strings.md
src/libcollectionstest/str.rs
src/libcore/str/mod.rs