diff options
| author | Maybe Lapkin <waffle.lapkin@gmail.com> | 2024-06-23 19:55:17 +0200 |
|---|---|---|
| committer | Maybe Lapkin <waffle.lapkin@gmail.com> | 2024-07-04 17:57:29 +0200 |
| commit | 340d69be12ffc03709340ec2d342db32406cd25f (patch) | |
| tree | d63bc4b06c1e16d26458338af9b626cb4bd1a669 /compiler/rustc_middle/src | |
| parent | c7435571ad725791494c32a48be1cd2c027af30b (diff) | |
Align the changes to the lang decision
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/predicate.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/predicate.rs b/compiler/rustc_middle/src/ty/predicate.rs index e9b37503bb3..3c327eb5b1d 100644 --- a/compiler/rustc_middle/src/ty/predicate.rs +++ b/compiler/rustc_middle/src/ty/predicate.rs @@ -341,6 +341,14 @@ impl<'tcx> ty::List<ty::PolyExistentialPredicate<'tcx>> { _ => None, }) } + + pub fn without_auto_traits( + &self, + ) -> impl Iterator<Item = ty::PolyExistentialPredicate<'tcx>> + '_ { + self.iter().filter(|predicate| { + !matches!(predicate.as_ref().skip_binder(), ExistentialPredicate::AutoTrait(_)) + }) + } } pub type PolyTraitRef<'tcx> = ty::Binder<'tcx, TraitRef<'tcx>>; |
