Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/predicate.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/predicate.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/crates/hir-ty/src/next_solver/predicate.rs b/crates/hir-ty/src/next_solver/predicate.rs index 30738dea5c..cf492e65c3 100644 --- a/crates/hir-ty/src/next_solver/predicate.rs +++ b/crates/hir-ty/src/next_solver/predicate.rs @@ -229,7 +229,7 @@ impl<'db> Predicate<'db> { /// Flips the polarity of a Predicate. /// /// Given `T: Trait` predicate it returns `T: !Trait` and given `T: !Trait` returns `T: Trait`. - pub fn flip_polarity(self) -> Option<Predicate<'db>> { + pub fn flip_polarity(self, interner: DbInterner<'db>) -> Option<Predicate<'db>> { let kind = self .kind() .map_bound(|kind| match kind { @@ -245,7 +245,7 @@ impl<'db> Predicate<'db> { }) .transpose()?; - Some(Predicate::new(DbInterner::conjure(), kind)) + Some(Predicate::new(interner, kind)) } } @@ -355,13 +355,6 @@ impl<'db> rustc_type_ir::inherent::SliceLike for Clauses<'db> { } } -impl<'db> Default for Clauses<'db> { - #[inline] - fn default() -> Self { - Clauses::empty(DbInterner::conjure()) - } -} - impl<'db> rustc_type_ir::inherent::Clauses<DbInterner<'db>> for Clauses<'db> {} impl<'db> rustc_type_ir::TypeSuperFoldable<DbInterner<'db>> for Clauses<'db> { @@ -444,8 +437,8 @@ pub struct ParamEnv<'db> { } impl<'db> ParamEnv<'db> { - pub fn empty() -> Self { - ParamEnv { clauses: Clauses::empty(DbInterner::conjure()) } + pub fn empty(interner: DbInterner<'db>) -> Self { + ParamEnv { clauses: Clauses::empty(interner) } } pub fn clauses(self) -> Clauses<'db> { |