diff options
author | Florian Diebold <[email protected]> | 2021-04-03 16:41:55 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-08 13:08:54 +0100 |
commit | e5d294765ae224ad59c6cd55442088fd3e604708 (patch) | |
tree | 66f3aa233c7792d7e75fc6762d43a594f9261979 /crates | |
parent | 429bbbd39a7bcb8650b522a9d683d20d76269770 (diff) |
Remove obsolete Cast impls
Diffstat (limited to 'crates')
-rw-r--r-- | crates/hir_ty/src/chalk_cast.rs | 47 |
1 files changed, 0 insertions, 47 deletions
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 { | |||
15 | }; | 15 | }; |
16 | } | 16 | } |
17 | 17 | ||
18 | has_interner!(WhereClause); | ||
19 | has_interner!(DomainGoal); | ||
20 | has_interner!(GenericArg); | ||
21 | has_interner!(Ty); | ||
22 | |||
23 | impl CastTo<WhereClause> for TraitRef { | ||
24 | fn cast_to(self, _interner: &Interner) -> WhereClause { | ||
25 | WhereClause::Implemented(self) | ||
26 | } | ||
27 | } | ||
28 | |||
29 | impl CastTo<WhereClause> for AliasEq { | ||
30 | fn cast_to(self, _interner: &Interner) -> WhereClause { | ||
31 | WhereClause::AliasEq(self) | ||
32 | } | ||
33 | } | ||
34 | |||
35 | impl CastTo<DomainGoal> for WhereClause { | ||
36 | fn cast_to(self, _interner: &Interner) -> DomainGoal { | ||
37 | DomainGoal::Holds(self) | ||
38 | } | ||
39 | } | ||
40 | |||
41 | impl CastTo<GenericArg> for Ty { | ||
42 | fn cast_to(self, interner: &Interner) -> GenericArg { | ||
43 | GenericArg::new(interner, GenericArgData::Ty(self)) | ||
44 | } | ||
45 | } | ||
46 | |||
47 | macro_rules! transitive_impl { | 18 | macro_rules! transitive_impl { |
48 | ($a:ty, $b:ty, $c:ty) => { | 19 | ($a:ty, $b:ty, $c:ty) => { |
49 | impl CastTo<$c> for $a { | 20 | impl CastTo<$c> for $a { |
@@ -53,21 +24,3 @@ macro_rules! transitive_impl { | |||
53 | } | 24 | } |
54 | }; | 25 | }; |
55 | } | 26 | } |
56 | |||
57 | // In Chalk, these can be done as blanket impls, but that doesn't work here | ||
58 | // because of coherence | ||
59 | |||
60 | transitive_impl!(TraitRef, WhereClause, DomainGoal); | ||
61 | transitive_impl!(AliasEq, WhereClause, DomainGoal); | ||
62 | |||
63 | macro_rules! reflexive_impl { | ||
64 | ($a:ty) => { | ||
65 | impl CastTo<$a> for $a { | ||
66 | fn cast_to(self, _interner: &Interner) -> $a { | ||
67 | self | ||
68 | } | ||
69 | } | ||
70 | }; | ||
71 | } | ||
72 | |||
73 | reflexive_impl!(GenericArg); | ||