aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ids.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-24 22:38:21 +0000
committerAleksey Kladov <[email protected]>2019-01-24 22:38:21 +0000
commit1ccf73c836d8a70d6f04b621bd6461f133669131 (patch)
treed3ef92f7da93aa7dde10731139df5b1709335ecb /crates/ra_hir/src/ids.rs
parentff9c5bef7b198cde4358610c565cd0b6dc466de5 (diff)
kill DefKindc
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r--crates/ra_hir/src/ids.rs24
1 files changed, 2 insertions, 22 deletions
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 {
313} 313}
314 314
315#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] 315#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
316pub(crate) enum DefKind { 316pub(crate) enum DefKind {}
317 Item,
318 // /// The constructor of a struct. E.g. if we have `struct Foo(usize)`, the
319 // /// name `Foo` needs to resolve to different types depending on whether we
320 // /// are in the types or values namespace: As a type, `Foo` of course refers
321 // /// to the struct `Foo`; as a value, `Foo` is a callable type with signature
322 // /// `(usize) -> Foo`. The cleanest approach to handle this seems to be to
323 // /// have different defs in the two namespaces.
324 // ///
325 // /// rustc does the same; note that it even creates a struct constructor if
326 // /// the struct isn't a tuple struct (see `CtorKind::Fictive` in rustc).
327 // StructCtor,
328}
329 317
330impl DefId { 318impl DefId {
331 pub(crate) fn loc(self, db: &impl AsRef<HirInterner>) -> DefLoc { 319 pub(crate) fn loc(self, db: &impl AsRef<HirInterner>) -> DefLoc {
@@ -334,15 +322,7 @@ impl DefId {
334 322
335 pub fn resolve(self, db: &impl HirDatabase) -> Def { 323 pub fn resolve(self, db: &impl HirDatabase) -> Def {
336 let loc = self.loc(db); 324 let loc = self.loc(db);
337 match loc.kind { 325 match loc.kind {}
338 DefKind::Item => Def::Item,
339 }
340 }
341}
342
343impl DefLoc {
344 pub(crate) fn id(&self, db: &impl AsRef<HirInterner>) -> DefId {
345 db.as_ref().defs.loc2id(&self)
346 } 326 }
347} 327}
348 328