[−][src]Function rustc_mir::const_eval::destructure_const
pub(crate) fn destructure_const<'tcx>(
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
val: &'tcx Const<'tcx>
) -> DestructuredConst<'tcx>
This function uses unwrap copiously, because an already validated constant
must have valid fields and can thus never fail outside of compiler bugs. However, it is
invoked from the pretty printer, where it can receive enums with no variants and e.g.
read_discriminant needs to be able to handle that.