mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
kill unused defs
This commit is contained in:
parent
566c8e321e
commit
ce2041252a
2 changed files with 0 additions and 7 deletions
|
@ -47,8 +47,6 @@ impl Crate {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Def {
|
pub enum Def {
|
||||||
Struct(Struct),
|
|
||||||
Enum(Enum),
|
|
||||||
EnumVariant(EnumVariant),
|
EnumVariant(EnumVariant),
|
||||||
Const(Const),
|
Const(Const),
|
||||||
Static(Static),
|
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::Struct(s) => type_for_struct(db, s),
|
||||||
TypableDef::Enum(e) => type_for_enum(db, e),
|
TypableDef::Enum(e) => type_for_enum(db, e),
|
||||||
TypableDef::Def(def_id) => match def_id.resolve(db) {
|
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),
|
Def::EnumVariant(ev) => type_for_enum_variant(db, ev),
|
||||||
_ => {
|
_ => {
|
||||||
log::debug!(
|
log::debug!(
|
||||||
|
@ -787,10 +786,6 @@ pub(super) fn type_for_field(db: &impl HirDatabase, def: VariantDef, field: Name
|
||||||
def_id.module(db),
|
def_id.module(db),
|
||||||
),
|
),
|
||||||
// TODO: unions
|
// TODO: unions
|
||||||
Def::Enum(_) => {
|
|
||||||
// this can happen in (invalid) code, but enums don't have fields themselves
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
_ => panic!(
|
_ => panic!(
|
||||||
"trying to get type for field {:?} in non-struct/variant {:?}",
|
"trying to get type for field {:?} in non-struct/variant {:?}",
|
||||||
field, def_id
|
field, def_id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue