diff options
| author | lcnr <rust@lcnr.de> | 2023-05-23 19:34:17 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2023-05-30 13:03:40 +0200 |
| commit | 6f9041bd1572239bec2d8653b84ea4ddd2a7d22d (patch) | |
| tree | 7209f9775747ea653b3a60a8f4436229254088f8 /compiler | |
| parent | 04056b5c04e0574d5631f04baab99d6fcd778550 (diff) | |
add the leak check to the new solver
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs b/compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs index fdb209fbff8..91a093f30bd 100644 --- a/compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs +++ b/compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs @@ -137,6 +137,11 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { #[instrument(level = "debug", skip(self), ret)] fn compute_external_query_constraints(&self) -> Result<ExternalConstraints<'tcx>, NoSolution> { + self.infcx.leak_check(ty::UniverseIndex::ROOT, None).map_err(|e| { + debug!(?e, "failed the leak check"); + NoSolution + })?; + // Cannot use `take_registered_region_obligations` as we may compute the response // inside of a `probe` whenever we have multiple choices inside of the solver. let region_obligations = self.infcx.inner.borrow().region_obligations().to_owned(); |
