Use Ty::apply instead of simple and fix method resolution.

This commit is contained in:
Charles Lew 2020-09-17 00:50:24 +08:00
parent eb96964756
commit 3fff5aa4d7
3 changed files with 14 additions and 8 deletions

View file

@ -250,6 +250,14 @@ impl Ty {
TypeCtor::Adt(def_id) => {
return Some(std::iter::once(def_id.module(db.upcast()).krate).collect())
}
TypeCtor::ForeignType(type_alias_id) => {
return Some(
std::iter::once(
type_alias_id.lookup(db.upcast()).module(db.upcast()).krate,
)
.collect(),
)
}
TypeCtor::Bool => lang_item_crate!("bool"),
TypeCtor::Char => lang_item_crate!("char"),
TypeCtor::Float(f) => match f.bitness {