aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r--crates/ra_hir/src/code_model.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 9fecba63d..20413cb3d 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -1055,3 +1055,13 @@ pub enum AssocItem {
1055// require not implementing From, and instead having some checked way of 1055// require not implementing From, and instead having some checked way of
1056// casting them, and somehow making the constructors private, which would be annoying. 1056// casting them, and somehow making the constructors private, which would be annoying.
1057impl_froms!(AssocItem: Function, Const, TypeAlias); 1057impl_froms!(AssocItem: Function, Const, TypeAlias);
1058
1059impl From<AssocItem> for crate::generics::GenericDef {
1060 fn from(item: AssocItem) -> Self {
1061 match item {
1062 AssocItem::Function(f) => f.into(),
1063 AssocItem::Const(c) => c.into(),
1064 AssocItem::TypeAlias(t) => t.into(),
1065 }
1066 }
1067}