Skip to content

Long message in panic: slicing out of bounds includes the whole string #32063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bluss opened this issue Mar 5, 2016 · 0 comments
Closed

Long message in panic: slicing out of bounds includes the whole string #32063

bluss opened this issue Mar 5, 2016 · 0 comments

Comments

@bluss
Copy link
Member

bluss commented Mar 5, 2016

The panic message for slicing out of bounds can be extremely long, since it includes the whole string!

bors added a commit that referenced this issue Mar 7, 2016
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant