Skip to content

Expose discriminant values in stable_mir #141639

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

NotLebedev
Copy link
Contributor

Resolves rust-lang/project-stable-mir#93

  • Added Discr struct to stable mir as stable version of struct with same name
  • Added discriminant_for_variant method to AdtDef and CoroutineDef

@rustbot
Copy link
Collaborator

rustbot commented May 27, 2025

r? @celinval

rustbot has assigned @celinval.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 May 27, 2025
@rust-log-analyzer

This comment has been minimized.

@NotLebedev
Copy link
Contributor Author

Uh, I think the job failed due to some rate limits and needs to be restarted?

Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Can you please add a test for this? Can you please make sure you cover generic and monomorphic code? Thanks!

@NotLebedev
Copy link
Contributor Author

Nice! Can you please add a test for this? Can you please make sure you cover generic and monomorphic code? Thanks!

Added a test for enum discriminant. I'm not sure how to best make tests for coroutines as I only have high level understanding of async/await not of the underlying coroutine mechanism. I would really appreciate some advice what I need to look at to create a test for CoroutineDef::discriminant_for_variant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose discriminant values in stable_mir
4 participants