diff options
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index b81899661..fcf8a1dbb 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -168,18 +168,7 @@ pub enum AdtDef { | |||
168 | Struct(Struct), | 168 | Struct(Struct), |
169 | Enum(Enum), | 169 | Enum(Enum), |
170 | } | 170 | } |
171 | 171 | impl_froms!(AdtDef: Struct, Enum); | |
172 | impl From<Struct> for AdtDef { | ||
173 | fn from(s: Struct) -> AdtDef { | ||
174 | AdtDef::Struct(s) | ||
175 | } | ||
176 | } | ||
177 | |||
178 | impl From<Enum> for AdtDef { | ||
179 | fn from(e: Enum) -> AdtDef { | ||
180 | AdtDef::Enum(e) | ||
181 | } | ||
182 | } | ||
183 | 172 | ||
184 | impl AdtDef { | 173 | impl AdtDef { |
185 | fn krate(self, db: &impl HirDatabase) -> Option<Crate> { | 174 | fn krate(self, db: &impl HirDatabase) -> Option<Crate> { |
@@ -701,24 +690,7 @@ pub enum TypableDef { | |||
701 | Enum(Enum), | 690 | Enum(Enum), |
702 | Def(DefId), | 691 | Def(DefId), |
703 | } | 692 | } |
704 | 693 | impl_froms!(TypableDef: Function, Struct, Enum); | |
705 | impl From<Function> for TypableDef { | ||
706 | fn from(func: Function) -> TypableDef { | ||
707 | TypableDef::Function(func) | ||
708 | } | ||
709 | } | ||
710 | |||
711 | impl From<Struct> for TypableDef { | ||
712 | fn from(s: Struct) -> TypableDef { | ||
713 | TypableDef::Struct(s) | ||
714 | } | ||
715 | } | ||
716 | |||
717 | impl From<Enum> for TypableDef { | ||
718 | fn from(e: Enum) -> TypableDef { | ||
719 | TypableDef::Enum(e) | ||
720 | } | ||
721 | } | ||
722 | 694 | ||
723 | impl From<DefId> for TypableDef { | 695 | impl From<DefId> for TypableDef { |
724 | fn from(func: DefId) -> TypableDef { | 696 | fn from(func: DefId) -> TypableDef { |
@@ -763,12 +735,7 @@ pub enum VariantDef { | |||
763 | Struct(Struct), | 735 | Struct(Struct), |
764 | Def(DefId), // EnumVariant | 736 | Def(DefId), // EnumVariant |
765 | } | 737 | } |
766 | 738 | impl_froms!(VariantDef: Struct); | |
767 | impl From<Struct> for VariantDef { | ||
768 | fn from(struct_: Struct) -> VariantDef { | ||
769 | VariantDef::Struct(struct_) | ||
770 | } | ||
771 | } | ||
772 | 739 | ||
773 | impl From<DefId> for VariantDef { | 740 | impl From<DefId> for VariantDef { |
774 | fn from(def_id: DefId) -> VariantDef { | 741 | fn from(def_id: DefId) -> VariantDef { |