Skip to content

Commit 8e353bb

Browse files
committed
Fix tidy err and review
1 parent 356ce96 commit 8e353bb

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,10 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
161161

162162
debug!(?concrete, "is_const_evaluatable");
163163
match concrete {
164-
Err(ErrorHandled::TooGeneric) => {
165-
Err(match substs.has_infer_types_or_consts() {
166-
true => NotConstEvaluatable::MentionsInfer,
167-
false => NotConstEvaluatable::MentionsParam,
168-
})
169-
}
164+
Err(ErrorHandled::TooGeneric) => Err(match substs.has_infer_types_or_consts() {
165+
true => NotConstEvaluatable::MentionsInfer,
166+
false => NotConstEvaluatable::MentionsParam,
167+
}),
170168
Err(ErrorHandled::Linted) => {
171169
infcx.tcx.sess.delay_span_bug(span, "constant in type had error reported as lint");
172170
Err(NotConstEvaluatable::Error(ErrorReported))

compiler/rustc_trait_selection/src/traits/fulfill.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -506,16 +506,12 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
506506
);
507507
ProcessResult::Unchanged
508508
}
509-
Err(NotConstEvaluatable::MentionsParam) => ProcessResult::Error(
510-
CodeSelectionError(SelectionError::NotConstEvaluatable(
511-
NotConstEvaluatable::MentionsParam,
512-
)),
513-
),
514-
Err(NotConstEvaluatable::Error(e)) => {
515-
ProcessResult::Error(CodeSelectionError(
516-
SelectionError::NotConstEvaluatable(NotConstEvaluatable::Error(e)),
517-
))
518-
}
509+
Err(
510+
e @ NotConstEvaluatable::MentionsParam
511+
| e @ NotConstEvaluatable::Error(_),
512+
) => ProcessResult::Error(CodeSelectionError(
513+
SelectionError::NotConstEvaluatable(e),
514+
)),
519515
}
520516
}
521517

0 commit comments

Comments
 (0)