I think it is cheaper to store the evaluated constant in crate metadata than to store its entire MIR. The only reason we encode the MIR right now is so that downstream crates can evaluate the constant again.
cc @rust-lang/wg-const-eval any problems with this that come to mind? We may be able to do this for promoteds in non-generic functions, too. Paired with polymorphization we can even do that for polymorphic constants at some point (as long as the value does not depend on the generic parameters).
I think it is cheaper to store the evaluated constant in crate metadata than to store its entire MIR. The only reason we encode the MIR right now is so that downstream crates can evaluate the constant again.
cc @rust-lang/wg-const-eval any problems with this that come to mind? We may be able to do this for promoteds in non-generic functions, too. Paired with polymorphization we can even do that for polymorphic constants at some point (as long as the value does not depend on the generic parameters).