Closed
Description
inline_const
tracking issue: #76001
Inspired by @oli-obk's comment in #85828 (comment)
For things like if const { expr } { 0 } else { do something complex }
it'd be nice to not have to even give LLVM the code for the else branch to have to emit. Ought to save time and binary size.
Tentatively marked mir-opt, since we presumably still need to make the MIR for it, in order to borrow-check and such the unreachable code. But might need to be codegen-time instead to pick up on monomorphized inline constants.
Hopefully should be doable relatively easily when the const is an inline const, since that forces const folding already, and thus there should just be a const true
in the MIR.