-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Linting shouldn't be run on optimized MIR #6080
Comments
missing_const_for_fn
runs on optimized MIR
According to @oli-obk on zulip, we can now use |
Remove a couple MIR usages changelog: none We use MIR to get the return type of a closure/function in a couple places. But typeck seems like a better approach. This is the easy part of #6080. Also did a tiny cleanup with `typeck` -> `typeck_body`.
I tried to switch over to |
@camsteffen is this still something to be fixed ? |
@InfRandomness yes I believe so |
Checking in once more: Would it be possible to add |
For example, const-checking needs to run before optimizations, otherwise it might miss some invalid operations that get optimized away. Specifically, it should run on the result of the
mir_const
query, but currently it usesoptimized_mir
. This is because the result of themir_const
query is "stolen" instead of cloned, so it no longer exists whenclippy
runs.clippy
tries to work around this by settingmir-opt-level=0
, but this doesn't disable every optimization pass.Until this is fixed,
missing_const_for_fn
will have false positives and/or ICE (due to some assertions about the state of the MIR at the point const-checking is run).The text was updated successfully, but these errors were encountered: