diff --git a/crates/hir_ty/src/traits/chalk/interner.rs b/crates/hir_ty/src/traits/chalk/interner.rs index 94e94a26df4..bd9395b7ed1 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs @@ -192,59 +192,58 @@ fn debug_quantified_where_clauses( tls::with_current_program(|prog| Some(prog?.debug_quantified_where_clauses(clauses, fmt))) } - fn intern_ty(&self, kind: chalk_ir::TyKind) -> Arc> { + fn intern_ty(&self, kind: chalk_ir::TyKind) -> Self::InternedType { let flags = kind.compute_flags(self); Arc::new(chalk_ir::TyData { kind, flags }) } - fn ty_data<'a>(&self, ty: &'a Arc>) -> &'a chalk_ir::TyData { + fn ty_data<'a>(&self, ty: &'a Self::InternedType) -> &'a chalk_ir::TyData { ty } - fn intern_lifetime( - &self, - lifetime: chalk_ir::LifetimeData, - ) -> chalk_ir::LifetimeData { + fn intern_lifetime(&self, lifetime: chalk_ir::LifetimeData) -> Self::InternedLifetime { lifetime } fn lifetime_data<'a>( &self, - lifetime: &'a chalk_ir::LifetimeData, + lifetime: &'a Self::InternedLifetime, ) -> &'a chalk_ir::LifetimeData { lifetime } - fn intern_const(&self, constant: chalk_ir::ConstData) -> Arc> { + fn intern_const(&self, constant: chalk_ir::ConstData) -> Self::InternedConst { Arc::new(constant) } - fn const_data<'a>( - &self, - constant: &'a Arc>, - ) -> &'a chalk_ir::ConstData { + fn const_data<'a>(&self, constant: &'a Self::InternedConst) -> &'a chalk_ir::ConstData { constant } - fn const_eq(&self, _ty: &Arc>, _c1: &(), _c2: &()) -> bool { + fn const_eq( + &self, + _ty: &Self::InternedType, + _c1: &Self::InternedConcreteConst, + _c2: &Self::InternedConcreteConst, + ) -> bool { true } fn intern_generic_arg( &self, parameter: chalk_ir::GenericArgData, - ) -> chalk_ir::GenericArgData { + ) -> Self::InternedGenericArg { parameter } fn generic_arg_data<'a>( &self, - parameter: &'a chalk_ir::GenericArgData, + parameter: &'a Self::InternedGenericArg, ) -> &'a chalk_ir::GenericArgData { parameter } - fn intern_goal(&self, goal: GoalData) -> Arc> { + fn intern_goal(&self, goal: GoalData) -> Self::InternedGoal { Arc::new(goal) } @@ -255,11 +254,11 @@ fn intern_goals( data.into_iter().collect() } - fn goal_data<'a>(&self, goal: &'a Arc>) -> &'a GoalData { + fn goal_data<'a>(&self, goal: &'a Self::InternedGoal) -> &'a GoalData { goal } - fn goals_data<'a>(&self, goals: &'a Vec>) -> &'a [Goal] { + fn goals_data<'a>(&self, goals: &'a Self::InternedGoals) -> &'a [Goal] { goals } @@ -280,13 +279,13 @@ fn substitution_data<'a>( fn intern_program_clause( &self, data: chalk_ir::ProgramClauseData, - ) -> Arc> { + ) -> Self::InternedProgramClause { Arc::new(data) } fn program_clause_data<'a>( &self, - clause: &'a Arc>, + clause: &'a Self::InternedProgramClause, ) -> &'a chalk_ir::ProgramClauseData { clause } @@ -294,13 +293,13 @@ fn program_clause_data<'a>( fn intern_program_clauses( &self, data: impl IntoIterator, E>>, - ) -> Result]>, E> { + ) -> Result { data.into_iter().collect() } fn program_clauses_data<'a>( &self, - clauses: &'a Arc<[chalk_ir::ProgramClause]>, + clauses: &'a Self::InternedProgramClauses, ) -> &'a [chalk_ir::ProgramClause] { &clauses }