Skip to content

fix: ICE when array index exceeds usize #12266

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

Merged

Conversation

granddaifuku
Copy link
Contributor

fixes #12253

This PR fixes ICE in indexing_slicing as it panics when the index of the array exceeds usize.

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Feb 10, 2024

r? @Manishearth

rustbot has assigned @Manishearth.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 10, 2024
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 12, 2024

📌 Commit c4d1108 has been approved by Manishearth

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 12, 2024

⌛ Testing commit c4d1108 with merge 7dfa6ce...

@y21 y21 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 12, 2024
@y21
Copy link
Member

y21 commented Feb 12, 2024

It's probably unlikely that anyone is realistically gonna run into this ICE in practice outside of fuzzing, considering you need to index with an integer greater than is allowed to begin with, but the ICE made it to beta and (I think) we've historically been beta backporting ICE fixes so, nominating this one

@bors
Copy link
Contributor

bors commented Feb 12, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 7dfa6ce to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Feb 12, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 7dfa6ce to master...

@bors bors merged commit 7dfa6ce into rust-lang:master Feb 12, 2024
@bors
Copy link
Contributor

bors commented Feb 12, 2024

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

@granddaifuku granddaifuku deleted the fix/ice-12253-index-exceeds-usize branch February 13, 2024 02:06
@flip1995 flip1995 added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Mar 14, 2024
@flip1995
Copy link
Member

flip1995 commented Mar 14, 2024

It's probably unlikely that anyone is realistically gonna run into this ICE in practice outside of fuzzing, considering you need to index with an integer greater than is allowed to begin with

I wouldn't create a backport PR just for this. But as there are other backports that should be done, I will just include this. It's a really small change, so nothing really speaks against backporting it. So nominating these is definitely right. 👍

@flip1995
Copy link
Member

rust-lang/rust#122510

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 16, 2024
…ulacrum

[beta] Clippy backports

Backports included in this PR:

- rust-lang/rust-clippy#12276 Fixing the lint on some platforms before hitting stable
- rust-lang/rust-clippy#12405 Respect MSRV before hitting stable
- rust-lang/rust-clippy#12266 Fixing an (unlikely) ICE
- rust-lang/rust-clippy#12177 Fixing FPs before hitting stable

Each backport on its own might not warrant a backport, but the collection of those are nice QoL fixes for Clippy users, before those bugs hit stable.

All of those commits are already on `master`.

r? `@Mark-Simulacrum`
@xFrednet xFrednet removed the beta-accepted Accepted for backporting to the compiler in the beta channel. label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: index_slicing TryFromIntError(())
7 participants