nits
This commit is contained in:
parent
f97e075e92
commit
342ec83629
1 changed files with 9 additions and 4 deletions
|
@ -108,7 +108,10 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
|
|||
FailureKind::MentionsParam => {
|
||||
return Err(NotConstEvaluatable::MentionsParam);
|
||||
}
|
||||
_ => (),
|
||||
FailureKind::Concrete => {
|
||||
// Dealt with below by the same code which handles this
|
||||
// without the feature gate.
|
||||
}
|
||||
}
|
||||
}
|
||||
None => {
|
||||
|
@ -158,10 +161,12 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
|
|||
|
||||
debug!(?concrete, "is_const_evaluatable");
|
||||
match concrete {
|
||||
Err(ErrorHandled::TooGeneric) if !substs.has_infer_types_or_consts() => {
|
||||
Err(NotConstEvaluatable::MentionsParam)
|
||||
Err(ErrorHandled::TooGeneric) => {
|
||||
return Err(match substs.has_infer_types_or_consts() {
|
||||
true => NotConstEvaluatable::MentionsInfer,
|
||||
false => NotConstEvaluatable::MentionsParam,
|
||||
});
|
||||
}
|
||||
Err(ErrorHandled::TooGeneric) => Err(NotConstEvaluatable::MentionsInfer),
|
||||
Err(ErrorHandled::Linted) => {
|
||||
infcx.tcx.sess.delay_span_bug(span, "constant in type had error reported as lint");
|
||||
Err(NotConstEvaluatable::Error(ErrorReported))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue