pub fn translate_constant_reference<'tcx>(
s: &impl UnderOwnerState<'tcx>,
span: Span,
ucv: UnevaluatedConst<'tcx>,
) -> Option<ConstantExpr>
Expand description
Attempts to translate a ty::UnevaluatedConst
into a constant expression. This handles cases
of references to top-level or associated constants. Returns None
if the input was not a named
constant.