about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-01-03 23:51:42 +0000
committerbors <bors@rust-lang.org>2017-01-03 23:51:42 +0000
commit468227129d08b52c4cf90313b29fdad1b80e596b (patch)
tree395f940c4de2fd358f5777c4f28b867a4174e2b6 /src/rustllvm/RustWrapper.cpp
parent8f62c2920077eb5cb81323142fc5dbe6ae8813c0 (diff)
parentd83fff3b3b9dd0fd6eef862e97f883d171367041 (diff)
downloadrust-468227129d08b52c4cf90313b29fdad1b80e596b.tar.gz
rust-468227129d08b52c4cf90313b29fdad1b80e596b.zip
Auto merge of #38066 - bluss:string-slice-error, r=sfackler
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.

It reports the first error it finds in:

1. begin out of bounds
2. end out of bounds
3. begin <= end violated
3. begin not char boundary
5. end not char boundary.

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αβγ`'

Fixes #38052
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions