Fix tidy err and review

This commit is contained in:
Ellen 2021-03-03 11:26:23 +00:00
parent 356ce96fe1
commit 8e353bb8ea
2 changed files with 10 additions and 16 deletions

View File

@ -161,12 +161,10 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
debug!(?concrete, "is_const_evaluatable");
match concrete {
Err(ErrorHandled::TooGeneric) => {
Err(match substs.has_infer_types_or_consts() {
true => NotConstEvaluatable::MentionsInfer,
false => NotConstEvaluatable::MentionsParam,
})
}
Err(ErrorHandled::TooGeneric) => Err(match substs.has_infer_types_or_consts() {
true => NotConstEvaluatable::MentionsInfer,
false => NotConstEvaluatable::MentionsParam,
}),
Err(ErrorHandled::Linted) => {
infcx.tcx.sess.delay_span_bug(span, "constant in type had error reported as lint");
Err(NotConstEvaluatable::Error(ErrorReported))

View File

@ -506,16 +506,12 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
);
ProcessResult::Unchanged
}
Err(NotConstEvaluatable::MentionsParam) => ProcessResult::Error(
CodeSelectionError(SelectionError::NotConstEvaluatable(
NotConstEvaluatable::MentionsParam,
)),
),
Err(NotConstEvaluatable::Error(e)) => {
ProcessResult::Error(CodeSelectionError(
SelectionError::NotConstEvaluatable(NotConstEvaluatable::Error(e)),
))
}
Err(
e @ NotConstEvaluatable::MentionsParam
| e @ NotConstEvaluatable::Error(_),
) => ProcessResult::Error(CodeSelectionError(
SelectionError::NotConstEvaluatable(e),
)),
}
}