aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs39
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 171impl_froms!(AdtDef: Struct, Enum);
172impl From<Struct> for AdtDef {
173 fn from(s: Struct) -> AdtDef {
174 AdtDef::Struct(s)
175 }
176}
177
178impl From<Enum> for AdtDef {
179 fn from(e: Enum) -> AdtDef {
180 AdtDef::Enum(e)
181 }
182}
183 172
184impl AdtDef { 173impl 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 693impl_froms!(TypableDef: Function, Struct, Enum);
705impl From<Function> for TypableDef {
706 fn from(func: Function) -> TypableDef {
707 TypableDef::Function(func)
708 }
709}
710
711impl From<Struct> for TypableDef {
712 fn from(s: Struct) -> TypableDef {
713 TypableDef::Struct(s)
714 }
715}
716
717impl From<Enum> for TypableDef {
718 fn from(e: Enum) -> TypableDef {
719 TypableDef::Enum(e)
720 }
721}
722 694
723impl From<DefId> for TypableDef { 695impl 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 738impl_froms!(VariantDef: Struct);
767impl From<Struct> for VariantDef {
768 fn from(struct_: Struct) -> VariantDef {
769 VariantDef::Struct(struct_)
770 }
771}
772 739
773impl From<DefId> for VariantDef { 740impl From<DefId> for VariantDef {
774 fn from(def_id: DefId) -> VariantDef { 741 fn from(def_id: DefId) -> VariantDef {