From ce2041252aba52662945e36a4afad454d19388ae Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 24 Jan 2019 18:57:38 +0300 Subject: kill unused defs --- crates/ra_hir/src/code_model_api.rs | 2 -- crates/ra_hir/src/ty.rs | 5 ----- 2 files changed, 7 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 0a96d6f6d..a094268ca 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -47,8 +47,6 @@ impl Crate { #[derive(Debug)] pub enum Def { - Struct(Struct), - Enum(Enum), EnumVariant(EnumVariant), Const(Const), Static(Static), diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 6a5f4fae6..b81899661 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -745,7 +745,6 @@ pub(super) fn type_for_def(db: &impl HirDatabase, def: TypableDef) -> Ty { TypableDef::Struct(s) => type_for_struct(db, s), TypableDef::Enum(e) => type_for_enum(db, e), TypableDef::Def(def_id) => match def_id.resolve(db) { - Def::Enum(e) => type_for_enum(db, e), Def::EnumVariant(ev) => type_for_enum_variant(db, ev), _ => { log::debug!( @@ -787,10 +786,6 @@ pub(super) fn type_for_field(db: &impl HirDatabase, def: VariantDef, field: Name def_id.module(db), ), // TODO: unions - Def::Enum(_) => { - // this can happen in (invalid) code, but enums don't have fields themselves - return None; - } _ => panic!( "trying to get type for field {:?} in non-struct/variant {:?}", field, def_id -- cgit v1.2.3