Handle C-variadic arguments properly when reporting region errors#86164
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 17, 2021
Merged
Handle C-variadic arguments properly when reporting region errors#86164bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
bjorn3
reviewed
Jun 12, 2021
|
|
||
| fn ordering4 < 'a , 'b > ( a : , self , self , self , | ||
| self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { | ||
| } |
Member
There was a problem hiding this comment.
Does this need to be formatted like this or can you run rustfmt on it?
Contributor
Author
There was a problem hiding this comment.
It doesn't need to be, but since this is a regression test, I have tried to reproduce the example from #86053 as closely as possible (the line break had to happen in order to make test tidy happy).
davidtwco
approved these changes
Jun 16, 2021
Member
davidtwco
left a comment
There was a problem hiding this comment.
Apologies for the delay in reviewing, this looks good to me.
Member
|
@bors r+ |
Collaborator
|
📌 Commit 7dccce0 has been approved by |
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes #86053. The issue is that for a C-variadic function
foo's signature will contain only the first parameter (and havec_variadicset totrue), whereas its body has a second argument (ahir::Patfor the...).The code for reporting region errors iterates over the body's parameters and tries to fetch the corresponding parameter from the signature; this causes an out-of-bounds ICE for the
...(though not in the example above, because there are no region errors to report).I have simply restricted the iteration over the body parameters to exclude
..., which is fine because...cannot cause a region error.