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

Add a stable MIR way to get the main function #110315

Merged
merged 1 commit into from
Apr 14, 2023
Merged

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 14, 2023

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.

@rustbot
Copy link
Collaborator

rustbot commented Apr 14, 2023

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 (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 14, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 14, 2023

This PR changes Stable MIR

cc @oli-obk, @celinval

@@ -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> {
Copy link
Member

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...

@WaffleLapkin
Copy link
Member

@bors r rollup

@bors
Copy link
Contributor

bors commented Apr 14, 2023

📌 Commit e404e77 has been approved by WaffleLapkin

It is now in the queue for this repository.

@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 Apr 14, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2023
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
@bors bors merged commit 4259133 into rust-lang:master Apr 14, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants