diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-26 11:32:09 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-26 11:32:09 +0000 |
commit | 6e36eadd261b1f7765bef32ec74899003c5c3517 (patch) | |
tree | 5f05620adde03f7cb521b2f59aad6b2470e6272e /crates/ra_hir/src/ty/method_resolution.rs | |
parent | 500e022f7decbee29a693b0f0dd2f63789a99e5a (diff) | |
parent | a443b5033c2e95ee58bf086f7093ddc610d4f78f (diff) |
Merge #2409
2409: Id-ify Ty::Adt r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/method_resolution.rs')
-rw-r--r-- | crates/ra_hir/src/ty/method_resolution.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index c5ab690eb..7f0ff2e8c 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -5,7 +5,7 @@ | |||
5 | use std::sync::Arc; | 5 | use std::sync::Arc; |
6 | 6 | ||
7 | use arrayvec::ArrayVec; | 7 | use arrayvec::ArrayVec; |
8 | use hir_def::{lang_item::LangItemTarget, resolver::Resolver, AstItemDef}; | 8 | use hir_def::{lang_item::LangItemTarget, resolver::Resolver, AstItemDef, HasModule}; |
9 | use rustc_hash::FxHashMap; | 9 | use rustc_hash::FxHashMap; |
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
@@ -102,7 +102,9 @@ fn def_crates(db: &impl HirDatabase, cur_crate: Crate, ty: &Ty) -> Option<ArrayV | |||
102 | 102 | ||
103 | let lang_item_targets = match ty { | 103 | let lang_item_targets = match ty { |
104 | Ty::Apply(a_ty) => match a_ty.ctor { | 104 | Ty::Apply(a_ty) => match a_ty.ctor { |
105 | TypeCtor::Adt(def_id) => return Some(std::iter::once(def_id.krate(db)?).collect()), | 105 | TypeCtor::Adt(def_id) => { |
106 | return Some(std::iter::once(def_id.module(db).krate.into()).collect()) | ||
107 | } | ||
106 | TypeCtor::Bool => lang_item_crate!("bool"), | 108 | TypeCtor::Bool => lang_item_crate!("bool"), |
107 | TypeCtor::Char => lang_item_crate!("char"), | 109 | TypeCtor::Char => lang_item_crate!("char"), |
108 | TypeCtor::Float(Uncertain::Known(f)) => match f.bitness { | 110 | TypeCtor::Float(Uncertain::Known(f)) => match f.bitness { |