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

Explain why clippy's HIR const eval exists #13615

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GnomedDev
Copy link
Contributor

When I initially found this, I was wondering why clippy wasn't just using miri, but after some discussion with some rustc folks let's document why.

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Oct 27, 2024

r? @Alexendoo

rustbot has assigned @Alexendoo.
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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 27, 2024
//!
//! This cannot use rustc's const eval, aka miri, as arbitrary hir expressions cannot be lowered to
//! executable MIR bodies, so we have to do this instead. If hir expressions gain the ability to be
//! lowered to executable mir bodies, this should be removed.
Copy link
Member

Choose a reason for hiding this comment

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

Do we have some issue/PR which we can link to track when it happens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not that I know of, I don't think it's even a goal. That's why I used "if" instead of "when".

Copy link
Contributor

Choose a reason for hiding this comment

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

HIR expressions are, practically, never going to gain that ability. We would have to maintain a translation layer in clippy for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shall I add a note to say "but this is practically never planned."?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants