Skip to content

Commit

Permalink
fix bad assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Mar 17, 2023
1 parent e624ef4 commit 9df35a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
7 changes: 0 additions & 7 deletions compiler/rustc_trait_selection/src/solve/canonical/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
let goals_certainty = self.try_evaluate_added_goals()?;
let certainty = certainty.unify_and(goals_certainty);

if let Certainty::Yes = certainty {
assert!(
self.nested_goals.is_empty(),
"Cannot be certain of query response if unevaluated goals exist"
);
}

let external_constraints = self.compute_external_query_constraints()?;

let response = Response { var_values: self.var_values, external_constraints, certainty };
Expand Down
10 changes: 4 additions & 6 deletions compiler/rustc_trait_selection/src/solve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
};
let result = ecx.evaluate_goal(IsNormalizesToHack::No, goal);

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

assert!(search_graph.is_empty());
result
Expand Down

0 comments on commit 9df35a5

Please sign in to comment.