Skip to content

Commit 342ec83

Browse files
committed
nits
1 parent f97e075 commit 342ec83

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
108108
FailureKind::MentionsParam => {
109109
return Err(NotConstEvaluatable::MentionsParam);
110110
}
111-
_ => (),
111+
FailureKind::Concrete => {
112+
// Dealt with below by the same code which handles this
113+
// without the feature gate.
114+
}
112115
}
113116
}
114117
None => {
@@ -158,10 +161,12 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
158161

159162
debug!(?concrete, "is_const_evaluatable");
160163
match concrete {
161-
Err(ErrorHandled::TooGeneric) if !substs.has_infer_types_or_consts() => {
162-
Err(NotConstEvaluatable::MentionsParam)
164+
Err(ErrorHandled::TooGeneric) => {
165+
return Err(match substs.has_infer_types_or_consts() {
166+
true => NotConstEvaluatable::MentionsInfer,
167+
false => NotConstEvaluatable::MentionsParam,
168+
});
163169
}
164-
Err(ErrorHandled::TooGeneric) => Err(NotConstEvaluatable::MentionsInfer),
165170
Err(ErrorHandled::Linted) => {
166171
infcx.tcx.sess.delay_span_bug(span, "constant in type had error reported as lint");
167172
Err(NotConstEvaluatable::Error(ErrorReported))

0 commit comments

Comments
 (0)