Function rustc_mir_transform::mir_for_ctfe_of_const_arg
source · pub(crate) fn mir_for_ctfe_of_const_arg<'tcx>(
tcx: TyCtxt<'tcx>,
(did, param_did): (LocalDefId, DefId)
) -> &'tcx Body<'tcx>
Expand description
Same as mir_for_ctfe
, but used to get the MIR of a const generic parameter.
The docs on WithOptConstParam
explain this a bit more, but the TLDR is that
we’d get cycle errors with mir_for_ctfe
, because typeck would need to typeck
the const parameter while type checking the main body, which in turn would try
to type check the main body again.