Skip to content

min const fn checks don't check set discriminant target #66556

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

Closed
oli-obk opened this issue Nov 19, 2019 · 3 comments · Fixed by #66790
Closed

min const fn checks don't check set discriminant target #66556

oli-obk opened this issue Nov 19, 2019 · 3 comments · Fixed by #66790
Assignees
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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 Nov 19, 2019

Leaving this issue as a reminder for https://github.com/rust-lang/rust/pull/66507/files#r347252249

It should be as simple as adding a check_place call to the SetDiscriminant

This issue has been assigned to @christianpoveda via this comment.

@oli-obk oli-obk added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) labels Nov 19, 2019
@ecstatic-morse
Copy link
Contributor

ecstatic-morse commented Nov 19, 2019

This bug appears in check_consts::validation as well:

// FIXME(eddyb) should these really do nothing?
StatementKind::FakeRead(..) |
StatementKind::SetDiscriminant { .. } |
StatementKind::StorageLive(_) |
StatementKind::StorageDead(_) |
StatementKind::InlineAsm {..} |
StatementKind::Retag { .. } |
StatementKind::AscribeUserType(..) |
StatementKind::Nop => {}

Might as well stop letting inline ASM through to MIRI while you're at it.

@pvdrz
Copy link
Contributor

pvdrz commented Nov 21, 2019

I'm taking this one :P

@Dylan-DPC-zz
Copy link

@rustbot assign @christianpoveda

@rustbot rustbot self-assigned this Nov 22, 2019
@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 26, 2019
@bors bors closed this as completed in 75fd413 Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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.

6 participants