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

-Zvalidate-mir should check that SwitchInt values are valid for their type #75440

Closed
oli-obk opened this issue Aug 12, 2020 · 0 comments · Fixed by #78085
Closed

-Zvalidate-mir should check that SwitchInt values are valid for their type #75440

oli-obk opened this issue Aug 12, 2020 · 0 comments · Fixed by #78085
Labels
A-mir-opt Area: MIR optimizations C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Aug 12, 2020

Hypothetically we could have a

SwitchInt {
    switch_ty: u8,
    values: [1, 2, 500],
    ...
}

we expect this not to happen, so this is an invariant of MIR that we can check

cc @rust-lang/wg-mir-opt @RalfJung

@oli-obk oli-obk added the A-mir-opt Area: MIR optimizations label Aug 12, 2020
@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 12, 2020
@bors bors closed this as completed in dbdc61f Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants