From 8692977d2798831d0aea434277ee54d589aa9be3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 23 Nov 2019 12:58:01 +0300 Subject: Move lang_items to hir_def --- crates/ra_hir/src/ty/autoderef.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src/ty/autoderef.rs') diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index b60e4bb31..41c99d227 100644 --- a/crates/ra_hir/src/ty/autoderef.rs +++ b/crates/ra_hir/src/ty/autoderef.rs @@ -5,12 +5,13 @@ use std::iter::successors; -use hir_def::resolver::Resolver; +use hir_def::{lang_item::LangItemTarget, resolver::Resolver}; use hir_expand::name; use log::{info, warn}; +use crate::{db::HirDatabase, Trait}; + use super::{traits::Solution, Canonical, Substs, Ty, TypeWalk}; -use crate::db::HirDatabase; const AUTODEREF_RECURSION_LIMIT: usize = 10; @@ -41,7 +42,7 @@ fn deref_by_trait( ) -> Option> { let krate = resolver.krate()?; let deref_trait = match db.lang_item(krate.into(), "deref".into())? { - crate::lang_item::LangItemTarget::Trait(t) => t, + LangItemTarget::TraitId(t) => Trait::from(t), _ => return None, }; let target = deref_trait.associated_type_by_name(db, &name::TARGET_TYPE)?; -- cgit v1.2.3