From e5d294765ae224ad59c6cd55442088fd3e604708 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 3 Apr 2021 17:41:55 +0200 Subject: Remove obsolete Cast impls --- crates/hir_ty/src/chalk_cast.rs | 47 ----------------------------------------- 1 file changed, 47 deletions(-) (limited to 'crates') diff --git a/crates/hir_ty/src/chalk_cast.rs b/crates/hir_ty/src/chalk_cast.rs index df6492113..1c3feabca 100644 --- a/crates/hir_ty/src/chalk_cast.rs +++ b/crates/hir_ty/src/chalk_cast.rs @@ -15,35 +15,6 @@ macro_rules! has_interner { }; } -has_interner!(WhereClause); -has_interner!(DomainGoal); -has_interner!(GenericArg); -has_interner!(Ty); - -impl CastTo for TraitRef { - fn cast_to(self, _interner: &Interner) -> WhereClause { - WhereClause::Implemented(self) - } -} - -impl CastTo for AliasEq { - fn cast_to(self, _interner: &Interner) -> WhereClause { - WhereClause::AliasEq(self) - } -} - -impl CastTo for WhereClause { - fn cast_to(self, _interner: &Interner) -> DomainGoal { - DomainGoal::Holds(self) - } -} - -impl CastTo for Ty { - fn cast_to(self, interner: &Interner) -> GenericArg { - GenericArg::new(interner, GenericArgData::Ty(self)) - } -} - macro_rules! transitive_impl { ($a:ty, $b:ty, $c:ty) => { impl CastTo<$c> for $a { @@ -53,21 +24,3 @@ macro_rules! transitive_impl { } }; } - -// In Chalk, these can be done as blanket impls, but that doesn't work here -// because of coherence - -transitive_impl!(TraitRef, WhereClause, DomainGoal); -transitive_impl!(AliasEq, WhereClause, DomainGoal); - -macro_rules! reflexive_impl { - ($a:ty) => { - impl CastTo<$a> for $a { - fn cast_to(self, _interner: &Interner) -> $a { - self - } - } - }; -} - -reflexive_impl!(GenericArg); -- cgit v1.2.3