Skip to content

Commit 9df35a5

Browse files
committed
fix bad assertion
1 parent e624ef4 commit 9df35a5

File tree

2 files changed

+4
-13
lines changed
  • compiler/rustc_trait_selection/src/solve

2 files changed

+4
-13
lines changed

Diff for: compiler/rustc_trait_selection/src/solve/canonical/mod.rs

-7
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
5555
let goals_certainty = self.try_evaluate_added_goals()?;
5656
let certainty = certainty.unify_and(goals_certainty);
5757

58-
if let Certainty::Yes = certainty {
59-
assert!(
60-
self.nested_goals.is_empty(),
61-
"Cannot be certain of query response if unevaluated goals exist"
62-
);
63-
}
64-
6558
let external_constraints = self.compute_external_query_constraints()?;
6659

6760
let response = Response { var_values: self.var_values, external_constraints, certainty };

Diff for: compiler/rustc_trait_selection/src/solve/mod.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,10 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
8888
};
8989
let result = ecx.evaluate_goal(IsNormalizesToHack::No, goal);
9090

91-
if let Ok((_, Certainty::Yes)) = result {
92-
assert!(
93-
ecx.nested_goals.is_empty(),
94-
"Cannot be certain of query response if unevaluated goals exist"
95-
);
96-
}
91+
assert!(
92+
ecx.nested_goals.is_empty(),
93+
"root `EvalCtxt` should not have any goals added to it"
94+
);
9795

9896
assert!(search_graph.is_empty());
9997
result

0 commit comments

Comments
 (0)