-
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
Add a stable MIR way to get the main function #110315
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @WaffleLapkin (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@@ -40,6 +40,10 @@ pub fn all_local_items() -> stable_mir::CrateItems { | |||
with(|tcx| tcx.mir_keys(()).iter().map(|item| crate_item(item.to_def_id())).collect()) | |||
} | |||
|
|||
pub fn entry_fn() -> Option<stable_mir::CrateItem> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect this to return FnItem
or something like this, but it looks like there isn't a stable_mir
counterpart to that, so ig that's ok...
@bors r+ rollup |
Rollup of 7 pull requests Successful merges: - rust-lang#103682 (Stabilize rustdoc `--test-run-directory`) - rust-lang#106249 (Create "suggested tests" tool in `rustbuild`) - rust-lang#110047 (Add link to `collections` docs to `extend` trait) - rust-lang#110269 (Add `tidy-alphabetical` to features in `core`) - rust-lang#110292 (Add `tidy-alphabetical` to features in `alloc` & `std`) - rust-lang#110305 (rustdoc-search: use ES6 `Map` and `Set` where they make sense) - rust-lang#110315 (Add a stable MIR way to get the main function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This is useful for analysis tools that only analyze the code paths that a specific program actually goes through. Or for code generators built on top of stable MIR.