wip lower impl trait to type args

This commit is contained in:
Florian Diebold 2020-01-24 19:35:09 +01:00
parent 9dec65d3b1
commit 93aa166748
8 changed files with 97 additions and 14 deletions

View file

@ -10,7 +10,7 @@ use hir_def::{
resolver::resolver_for_expr,
AdtId, AssocContainerId, Lookup, StructFieldId,
};
use hir_expand::name::{name, Name};
use hir_expand::name::Name;
use ra_syntax::ast::RangeOp;
use crate::{
@ -654,7 +654,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
// Parent arguments are unknown, except for the receiver type
if let Some(parent_generics) = def_generics.as_ref().map(|p| p.iter_parent()) {
for (_id, param) in parent_generics {
if param.name == name![Self] {
if param.provenance == hir_def::generics::TypeParamProvenance::TraitSelf {
substs.push(receiver_ty.clone());
} else {
substs.push(Ty::Unknown);