aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/name.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-05-12 17:33:47 +0100
committerFlorian Diebold <[email protected]>2019-06-15 17:21:23 +0100
commit9c5e7dd849eff7bd6f20aa353feef083d089ff58 (patch)
tree5639ff8814d3f4ba0f5ac41de215ed3720f3d1b9 /crates/ra_hir/src/name.rs
parent49489dc20cc9f340d43acb467677b9bc59495ed2 (diff)
Implement autoderef using the Deref trait
- add support for other lang item targets, since we need the Deref lang item
Diffstat (limited to 'crates/ra_hir/src/name.rs')
-rw-r--r--crates/ra_hir/src/name.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir/src/name.rs b/crates/ra_hir/src/name.rs
index e9003e00b..ba17958eb 100644
--- a/crates/ra_hir/src/name.rs
+++ b/crates/ra_hir/src/name.rs
@@ -46,6 +46,11 @@ impl Name {
46 Name::new(idx.to_string().into()) 46 Name::new(idx.to_string().into())
47 } 47 }
48 48
49 // Needed for Deref
50 pub(crate) fn target() -> Name {
51 Name::new("Target".into())
52 }
53
49 // There's should be no way to extract a string out of `Name`: `Name` in the 54 // There's should be no way to extract a string out of `Name`: `Name` in the
50 // future, `Name` will include hygiene information, and you can't encode 55 // future, `Name` will include hygiene information, and you can't encode
51 // hygiene into a String. 56 // hygiene into a String.