From 9c5e7dd849eff7bd6f20aa353feef083d089ff58 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 12 May 2019 18:33:47 +0200 Subject: Implement autoderef using the Deref trait - add support for other lang item targets, since we need the Deref lang item --- crates/ra_hir/src/name.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/ra_hir/src/name.rs') 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 { Name::new(idx.to_string().into()) } + // Needed for Deref + pub(crate) fn target() -> Name { + Name::new("Target".into()) + } + // There's should be no way to extract a string out of `Name`: `Name` in the // future, `Name` will include hygiene information, and you can't encode // hygiene into a String. -- cgit v1.2.3