Open
Description
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 uses optimized_mir
. This is because the result of the mir_const
query is "stolen" instead of cloned, so it no longer exists when clippy
runs. clippy
tries to work around this by setting mir-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).