Skip to content

Rollup of 4 pull requests #74752

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
wants to merge 10 commits into from

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

LukasKalbertodt and others added 10 commits July 19, 2020 16:11
Before, the `Range` method was called with `end = slice.len()`.
Unfortunately, because `Range::index` first checks the order of the
indices (start has to be smaller than end), an out of bounds index
leads to `core::slice::slice_index_order_fail` being called. This
prints the message 'slice index starts at 27 but ends at 10', which is
worse than 'index 27 out of range for slice of length 10'. This is not
only useful to normal users reading panic messages, but also for people
inspecting assembly and being confused by `slice_index_order_fail`
calls.
…x-panic, r=hanna-kruppe

Fix panic message when `RangeFrom` index is out of bounds

Before, the `Range` method was called with `end = slice.len()`. Unfortunately, because `Range::index` first checks the order of the indices (start has to be smaller than end), an out of bounds index leads to `core::slice::slice_index_order_fail` being called. This prints the message 'slice index starts at 27 but ends at 10', which is worse than 'index 27 out of range for slice of length 10'. This is not only useful to normal users reading panic messages, but also for people inspecting assembly and being confused by `slice_index_order_fail` calls.

You can see the produced assembly [here](https://rust.godbolt.org/z/GzMGWf) and try on Playground [here](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=aada5996b2f3848075a6d02cf4055743). (By the way. this is only about which panic function is called; I'm pretty sure it does not improve anything about performance).
…atthewjasper

Detect turbofish missing surrounding angle brackets

Fix rust-lang#74065.
…estebank

Use the proper span when WF-checking an impl self type
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

Successfully merging this pull request may close these issues.

None yet

5 participants