]> git.lizzy.rs Git - rust.git/commit
Auto merge of #32064 - bluss:str-slice-panic, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 7 Mar 2016 02:28:09 +0000 (02:28 +0000)
committerbors <bors@rust-lang.org>
Mon, 7 Mar 2016 02:28:09 +0000 (02:28 +0000)
commit6eb81a1f3bc27f2160048c09e3936486b4c9ef59
tree93a347caa2ad77a748f6d0675fa7a8398633777a
parent998a6720b68bcb0fef67daa5d258ff2f8e5b99b8
parent4594f0f67aad77839d5a41353224fee186bfcda9
Auto merge of #32064 - bluss:str-slice-panic, r=alexcrichton

Fix panic on string slicing error to truncate the string

The string may be arbitrarily long, but we want to limit the panic
message to a reasonable length. Truncate the string if it is too long
(simply to char boundary).

Also add details to the start <= end message. I think it's ok to flesh
out the code here, since it's in a cold function.

Fixes #32063
src/libcore/str/mod.rs