mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
add assert
This commit is contained in:
parent
ee31e5fc57
commit
ea08d3a47c
@ -78,15 +78,22 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
|
||||
) -> Result<(bool, Certainty), NoSolution> {
|
||||
let mut search_graph = search_graph::SearchGraph::new(self.tcx);
|
||||
|
||||
let result = EvalCtxt {
|
||||
let mut ecx = EvalCtxt {
|
||||
search_graph: &mut search_graph,
|
||||
infcx: self,
|
||||
// Only relevant when canonicalizing the response.
|
||||
max_input_universe: ty::UniverseIndex::ROOT,
|
||||
var_values: CanonicalVarValues::dummy(),
|
||||
nested_goals: NestedGoals::new(),
|
||||
};
|
||||
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"
|
||||
);
|
||||
}
|
||||
.evaluate_goal(IsNormalizesToHack::No, goal);
|
||||
|
||||
assert!(search_graph.is_empty());
|
||||
result
|
||||
|
Loading…
Reference in New Issue
Block a user