-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Don't resolve blocks in foreign functions #92510
Merged
Merged
Conversation
This file contains 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
rustbot
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jan 3, 2022
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jan 3, 2022
inquisitivecrystal
changed the title
Do not resolve blocks in foreign functions
Don't resolve blocks in foreign functions
Jan 3, 2022
@bors r+ |
📌 Commit f56a6527a546b1a9555fb4ae7f8dd90d23a35483 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 3, 2022
@bors r- too fast |
bors
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Jan 3, 2022
cjgillot
reviewed
Jan 3, 2022
r=me with nit addressed. Thanks @inquisitivecrystal! |
inquisitivecrystal
force-pushed
the
foreign-block
branch
from
January 5, 2022 22:15
f56a652
to
0ec2b29
Compare
inquisitivecrystal
force-pushed
the
foreign-block
branch
from
January 5, 2022 23:23
0ec2b29
to
42de973
Compare
@cjgillot Thank you for your advice! The nits have been addressed. Unfortunately, I don't have |
inquisitivecrystal
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Jan 6, 2022
@bors r+ |
📌 Commit 42de973 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 6, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 6, 2022
…=cjgillot Don't resolve blocks in foreign functions Although it is an error for a foreign function to have a block, it is still possible at the level of the AST. rust-lang#74204 made AST lowering skip over blocks belonging to foreign functions, since they're invalid. However, resolve still treated these blocks normally, resulting in a mismatch between the HIR and resolve, which could cause an ICE under certain circumstances. This PR changes resolve to skip over blocks belonging to foreign functions, as AST lowering does. Fixes rust-lang#91370. r? `@cjgillot`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 9, 2022
…askrgr Rollup of 8 pull requests Successful merges: - rust-lang#92055 (Add release notes for 1.58) - rust-lang#92490 (Move crate drop-down to search results page) - rust-lang#92510 (Don't resolve blocks in foreign functions) - rust-lang#92573 (expand: Refactor InvocationCollector visitor for better code reuse) - rust-lang#92608 (rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes) - rust-lang#92657 (Implemented const casts of raw pointers) - rust-lang#92671 (Make `Atomic*::from_mut` return `&mut Atomic*`) - rust-lang#92673 (Remove useless collapse toggle on "all items" page) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-resolve
Area: Name resolution
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Although it is an error for a foreign function to have a block, it is still possible at the level of the AST. #74204 made AST lowering skip over blocks belonging to foreign functions, since they're invalid. However, resolve still treated these blocks normally, resulting in a mismatch between the HIR and resolve, which could cause an ICE under certain circumstances. This PR changes resolve to skip over blocks belonging to foreign functions, as AST lowering does.
Fixes #91370.
r? @cjgillot