kill unused defs
This commit is contained in:
parent
566c8e321e
commit
ce2041252a
@ -47,8 +47,6 @@ impl Crate {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Def {
|
||||
Struct(Struct),
|
||||
Enum(Enum),
|
||||
EnumVariant(EnumVariant),
|
||||
Const(Const),
|
||||
Static(Static),
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user