fn build_error_for_const_call<'tcx>(
ccx: &ConstCx<'_, 'tcx>,
callee: DefId,
args: GenericArgsRef<'tcx>,
span: Span,
call_source: CallSource,
non_or_conditionally: &'static str,
note_trait_if_possible: impl FnOnce(&mut Diag<'tcx>, Ty<'tcx>, DefId),
) -> Diag<'tcx>
Expand description
Build an error message reporting that a function call is not const (or only
conditionally const). In case that this call is desugared (like an operator
or sugar from something like a for
loop), try to build a better error message
that doesn’t call it a method.