-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
base: master
Are you sure you want to change the base?
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
clippy_utils/src/consts.rs
Outdated
//! | ||
//! 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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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."?
97381d3
to
339c4ff
Compare
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