-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Break when there is a mismatch in the type count #83535
Conversation
When other errors are generated, there can be a mismatch between the amount of input types in MIR, and the amount in the function itself. Break from the comparative loop if this is the case to prevent out-of-bounds.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I'm not sure if the code in #83499 should be added as a test or not, hence the draft status. |
Could someone else review this? I'm not familiar with the area. |
@MidasLamb Yeah, it'd be great if we could add a test. If you aren't sure how to add, see this page: https://rustc-dev-guide.rust-lang.org/tests/adding.html |
This looks great except for needing a test, agreed. |
Add a test that has the right input to trigger an out-of-bounds error when in MIR the local_decls and the normalized_input_tys don't match in amount.
@JohnTitor , @nikomatsakis , I've added the test, was a bit more figuring out than I anticipated because I couldn't really find a place for "this shouldn't crash the compiler" and not make any other assumptions. |
Looks good! @bors r+ |
📌 Commit 2d813b2 has been approved by |
…r=nikomatsakis Break when there is a mismatch in the type count When other errors are generated, there can be a mismatch between the amount of input types in MIR, and the amount in the function itself. Break from the comparative loop if this is the case to prevent out-of-bounds. Fixes rust-lang#83499
…r=nikomatsakis Break when there is a mismatch in the type count When other errors are generated, there can be a mismatch between the amount of input types in MIR, and the amount in the function itself. Break from the comparative loop if this is the case to prevent out-of-bounds. Fixes rust-lang#83499
…r=nikomatsakis Break when there is a mismatch in the type count When other errors are generated, there can be a mismatch between the amount of input types in MIR, and the amount in the function itself. Break from the comparative loop if this is the case to prevent out-of-bounds. Fixes rust-lang#83499
Rollup of 5 pull requests Successful merges: - rust-lang#83535 (Break when there is a mismatch in the type count) - rust-lang#83721 (Add a button to copy the "use statement") - rust-lang#83740 (Fix comment typo in once.rs) - rust-lang#83745 (Add my new email address to .mailmap) - rust-lang#83754 (Add test to ensure search tabs behaviour) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When other errors are generated, there can be a mismatch between the
amount of input types in MIR, and the amount in the function itself.
Break from the comparative loop if this is the case to prevent
out-of-bounds.
Fixes #83499