-
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
Implement RFC 1260 with feature_name imported_main
.
#84401
Conversation
cbc1642
to
84a4ab3
Compare
This comment has been minimized.
This comment has been minimized.
status update: still trying to find a way to migrate https://github.com/rust-lang/rust/blob/master/compiler/rustc_typeck/src/lib.rs#L167 to support non-local |
84a4ab3
to
2d4c666
Compare
Status update: Updated the types and modified Currently still a linking error with the non-local case... |
This comment has been minimized.
This comment has been minimized.
2d4c666
to
1eff17f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Added a mechanism to ensure there's a codegen unit that's appointed to deal with the main_wrapper generation. cc @bjorn3 in case there's potential effect on cranelift codegen. |
This comment has been minimized.
This comment has been minimized.
I can't help with codegen issues with foreign main. |
This comment has been minimized.
This comment has been minimized.
main_by_path
.imported_main
.
5ee043c
to
7d7c553
Compare
Rebased and addressed the review comments. I'll leave the codegen changes to another PR. Surprisingly, the last-seen CI-failure is actually not caused by codegen, but by the previously used |
This comment has been minimized.
This comment has been minimized.
c0fe1d3
to
9182f04
Compare
Rebased and address the comments above in a new commit for easier reviewing. |
r=me with commits squashed. |
9182f04
to
d261df4
Compare
Squashed the commits. |
@bors r+ |
📌 Commit d261df4 has been approved by |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@bcd696d. Direct link to PR: <rust-lang/rust#84401> 💔 miri on windows: test-pass → build-fail (cc @RalfJung @eddyb @oli-obk). 💔 miri on linux: test-pass → build-fail (cc @RalfJung @eddyb @oli-obk).
…enkov Implement RFC 1260 with feature_name `imported_main`. This is the second extraction part of rust-lang#84062 plus additional adjustments. This (mostly) implements RFC 1260. However there's still one test case failure in the extern crate case. Maybe `LocalDefId` doesn't work here? I'm not sure. cc rust-lang#28937 r? `@petrochenkov`
…r=varkor Fix ICE when `main` is declared in an `extern` block Changes in rust-lang#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 rust-lang#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 rust-lang#86110
This is the second extraction part of #84062 plus additional adjustments.
This (mostly) implements RFC 1260.
However there's still one test case failure in the extern crate case. Maybe
LocalDefId
doesn't work here? I'm not sure.cc #28937
r? @petrochenkov