Remove trivial region constraints

This commit is contained in:
Michael Goulet 2023-08-02 01:31:48 +00:00
parent eaf8af5de8
commit f848fd3ae3

View File

@ -94,8 +94,13 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
let var_values = self.var_values; let var_values = self.var_values;
let external_constraints = self.compute_external_query_constraints()?; let external_constraints = self.compute_external_query_constraints()?;
let (var_values, external_constraints) = let (var_values, mut external_constraints) =
(var_values, external_constraints).fold_with(&mut EagerResolver { infcx: self.infcx }); (var_values, external_constraints).fold_with(&mut EagerResolver { infcx: self.infcx });
// Remove any trivial region constraints once we've resolved regions
external_constraints
.region_constraints
.outlives
.retain(|(outlives, _)| outlives.0.as_region().map_or(true, |re| re != outlives.1));
let canonical = Canonicalizer::canonicalize( let canonical = Canonicalizer::canonicalize(
self.infcx, self.infcx,