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

Fix ICE when main is declared in an extern block #86190

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

asquared31415
Copy link
Contributor

@asquared31415 asquared31415 commented Jun 10, 2021

Changes in #84401 to implement imported_main changed how the crate entry point is found, and a declared main in an extern block was detected erroneously. This was causing the ICE described in #86110.

This PR adds a check for this case and emits an error instead. Previously a main declaration in an extern block was not detected as an entry point at all, so emitting an error shouldn't break anything that worked previously. In 1.52.1 stable this is demonstrated, with a `main` function not found error.

Fixes #86110

@rust-highfive
Copy link
Collaborator

r? @varkor

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 10, 2021
@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 26, 2021
@varkor
Copy link
Member

varkor commented Jun 30, 2021

@bors r+

Sorry for the delay.

@bors
Copy link
Contributor

bors commented Jun 30, 2021

📌 Commit 9b2ba6d has been approved by varkor

@bors 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 Jun 30, 2021
@bors
Copy link
Contributor

bors commented Jul 1, 2021

⌛ Testing commit 9b2ba6d with merge f8ac8fd...

@bors
Copy link
Contributor

bors commented Jul 1, 2021

☀️ Test successful - checks-actions
Approved by: varkor
Pushing f8ac8fd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 1, 2021
@bors bors merged commit f8ac8fd into rust-lang:master Jul 1, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 1, 2021
@asquared31415 asquared31415 deleted the extern-main-86110-fix branch July 7, 2021 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error while building with main being extern (a separately compiled C module)
6 participants