diff options
| author | lcnr <rust@lcnr.de> | 2022-07-14 12:47:38 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-07-14 12:48:50 +0200 |
| commit | 864d2f35280aadeaf63f6e7efa483e173ebd62f6 (patch) | |
| tree | 608de1f6e23879ad0a8111c7247f497e0eb2ab01 /compiler/rustc_trait_selection/src/traits | |
| parent | 39a990d2f126b4751bd7821f26d166e07b073915 (diff) | |
| download | rust-864d2f35280aadeaf63f6e7efa483e173ebd62f6.tar.gz rust-864d2f35280aadeaf63f6e7efa483e173ebd62f6.zip | |
eagerly check for bound vars of predicates
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 054308e441a..9de4d3a646c 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -756,6 +756,10 @@ impl<'tcx> TypeFolder<'tcx> for BoundVarReplacer<'_, 'tcx> { _ => ct.super_fold_with(self), } } + + fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> { + if p.has_vars_bound_at_or_above(self.current_index) { p.super_fold_with(self) } else { p } + } } // The inverse of `BoundVarReplacer`: replaces placeholders with the bound vars from which they came. |
