diff options
| author | Boxy <supbscripter@gmail.com> | 2023-03-17 14:40:16 +0000 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2023-03-17 14:40:21 +0000 |
| commit | 9df35a5050e49b17bae559a074cb30798f8ca6da (patch) | |
| tree | 858e336fd44bd020507611e6eda7ba5f99796391 | |
| parent | e624ef4d64cc800b9d69104bd3f77fc10d65080b (diff) | |
| download | rust-9df35a5050e49b17bae559a074cb30798f8ca6da.tar.gz rust-9df35a5050e49b17bae559a074cb30798f8ca6da.zip | |
fix bad assertion
| -rw-r--r-- | compiler/rustc_trait_selection/src/solve/canonical/mod.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/solve/mod.rs | 10 |
2 files changed, 4 insertions, 13 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/canonical/mod.rs b/compiler/rustc_trait_selection/src/solve/canonical/mod.rs index 01a011a000e..9d45e78ebab 100644 --- a/compiler/rustc_trait_selection/src/solve/canonical/mod.rs +++ b/compiler/rustc_trait_selection/src/solve/canonical/mod.rs @@ -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 }; diff --git a/compiler/rustc_trait_selection/src/solve/mod.rs b/compiler/rustc_trait_selection/src/solve/mod.rs index 13d6602b7e1..5986b40d9a9 100644 --- a/compiler/rustc_trait_selection/src/solve/mod.rs +++ b/compiler/rustc_trait_selection/src/solve/mod.rs @@ -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 |
