Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/region.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/region.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/hir-ty/src/next_solver/region.rs b/crates/hir-ty/src/next_solver/region.rs index 13c333b9d5..5e7eb7532b 100644 --- a/crates/hir-ty/src/next_solver/region.rs +++ b/crates/hir-ty/src/next_solver/region.rs @@ -3,7 +3,8 @@ use hir_def::LifetimeParamId; use intern::{Interned, Symbol}; use rustc_type_ir::{ - BoundVar, Flags, INNERMOST, RegionVid, TypeFlags, TypeFoldable, TypeVisitable, VisitorResult, + BoundVar, DebruijnIndex, Flags, INNERMOST, RegionVid, TypeFlags, TypeFoldable, TypeVisitable, + VisitorResult, inherent::{IntoKind, PlaceholderLike, SliceLike}, relate::Relate, }; @@ -62,6 +63,14 @@ impl<'db> Region<'db> { Region::new(interner, RegionKind::ReErased) } + pub fn new_bound( + interner: DbInterner<'db>, + index: DebruijnIndex, + bound: BoundRegion, + ) -> Region<'db> { + Region::new(interner, RegionKind::ReBound(index, bound)) + } + pub fn is_placeholder(&self) -> bool { matches!(self.inner(), RegionKind::RePlaceholder(..)) } |