Rollup of 8 pull requests by Centril · Pull Request #67532 · rust-lang/rust (original) (raw)

…r=oli-obk

Add simpler entry points to const eval for common usages.

I found the tcx.const_eval API to be complex/awkward to work with, because of the inherent complexity from all of the different situations it is called from. Though it mainly used in one of the following ways:

This PR adds three new functions const_eval_mono, const_eval_resolve, and const_eval_promoted to TyCtxt, which each cater to one of the three ways tcx.const_eval is normally used.