Skip to content
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

indexing_slicing should not fire if a valid array index comes from a constant function that is evaluated at compile-time #8588

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

pitaj
Copy link
Contributor

@pitaj pitaj commented Mar 26, 2022

fix #8348

changelog: [indexing_slicing] fewer false positives in const contexts and with const indices

- should not fire if indexing with a constant block
- should not fire if indexing within a constant context
(const statement or const block)
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 26, 2022
bors added a commit that referenced this pull request Mar 30, 2022
Do not fire `panic` in a constant environment

Let rustc handle panics in constant environments.

Since #8348 I thought that such modification would require a lot of work but thanks to #8588 I now know that it is not the case.

changelog: [`panic`]: No longer lint in constant context. `rustc` already handles this.
@pitaj
Copy link
Contributor Author

pitaj commented Mar 30, 2022

@flip1995 bump

@flip1995
Copy link
Member

flip1995 commented Apr 6, 2022

@bors r+

Thanks!

Sorry for the delay.

@bors
Copy link
Collaborator

bors commented Apr 6, 2022

📌 Commit 21eae8c has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Apr 6, 2022

⌛ Testing commit 21eae8c with merge 41f2ecc...

@bors
Copy link
Collaborator

bors commented Apr 6, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 41f2ecc to master...

@bors bors merged commit 41f2ecc into rust-lang:master Apr 6, 2022
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
4 participants