From 1ccf73c836d8a70d6f04b621bd6461f133669131 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Jan 2019 01:38:21 +0300 Subject: kill DefKindc --- crates/ra_hir/src/ids.rs | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'crates/ra_hir/src/ids.rs') diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 311c0b98a..cbe31f830 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -313,19 +313,7 @@ pub struct DefLoc { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] -pub(crate) enum DefKind { - Item, - // /// The constructor of a struct. E.g. if we have `struct Foo(usize)`, the - // /// name `Foo` needs to resolve to different types depending on whether we - // /// are in the types or values namespace: As a type, `Foo` of course refers - // /// to the struct `Foo`; as a value, `Foo` is a callable type with signature - // /// `(usize) -> Foo`. The cleanest approach to handle this seems to be to - // /// have different defs in the two namespaces. - // /// - // /// rustc does the same; note that it even creates a struct constructor if - // /// the struct isn't a tuple struct (see `CtorKind::Fictive` in rustc). - // StructCtor, -} +pub(crate) enum DefKind {} impl DefId { pub(crate) fn loc(self, db: &impl AsRef) -> DefLoc { @@ -334,15 +322,7 @@ impl DefId { pub fn resolve(self, db: &impl HirDatabase) -> Def { let loc = self.loc(db); - match loc.kind { - DefKind::Item => Def::Item, - } - } -} - -impl DefLoc { - pub(crate) fn id(&self, db: &impl AsRef) -> DefId { - db.as_ref().defs.loc2id(&self) + match loc.kind {} } } -- cgit v1.2.3