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

Support Rvalue::Discriminant not followed by SwitchInt #120

Closed
Nadrieril opened this issue Apr 12, 2024 · 0 comments · Fixed by #132
Closed

Support Rvalue::Discriminant not followed by SwitchInt #120

Nadrieril opened this issue Apr 12, 2024 · 0 comments · Fixed by #132
Assignees
Labels
C-unsupported-language-feature A rust feature we don't extract well

Comments

@Nadrieril
Copy link
Member

Nadrieril commented Apr 12, 2024

This can show up in optimized MIR, for example the optimized mir of Option::is_some(). It's not too hard to support: we can replace _x = Discriminant(_y) with

match _y {
    Variant1 => _x = <discriminant value for variant 1>,
    ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-unsupported-language-feature A rust feature we don't extract well
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant