diff options
author | Florian Diebold <[email protected]> | 2019-09-07 13:31:43 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-09-07 13:31:43 +0100 |
commit | 60bdb66ef23f78d8c73afa1897a4542e7e722ed2 (patch) | |
tree | cc5dc599d3c369a4769c792a2c440749ed4b7771 /crates/ra_hir/src/ty/autoderef.rs | |
parent | 4ae4d9c311084e3092eb4c2d35e98f6c2c70315b (diff) |
Lower bounds on trait definition, and resolve assoc types from super traits
Diffstat (limited to 'crates/ra_hir/src/ty/autoderef.rs')
-rw-r--r-- | crates/ra_hir/src/ty/autoderef.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index 08f52a53b..caa17f64e 100644 --- a/crates/ra_hir/src/ty/autoderef.rs +++ b/crates/ra_hir/src/ty/autoderef.rs | |||
@@ -8,7 +8,7 @@ use std::iter::successors; | |||
8 | use log::{info, warn}; | 8 | use log::{info, warn}; |
9 | 9 | ||
10 | use super::{traits::Solution, Canonical, Ty, TypeWalk}; | 10 | use super::{traits::Solution, Canonical, Ty, TypeWalk}; |
11 | use crate::{HasGenericParams, HirDatabase, Name, Resolver}; | 11 | use crate::{name, HasGenericParams, HirDatabase, Resolver}; |
12 | 12 | ||
13 | const AUTODEREF_RECURSION_LIMIT: usize = 10; | 13 | const AUTODEREF_RECURSION_LIMIT: usize = 10; |
14 | 14 | ||
@@ -42,7 +42,7 @@ fn deref_by_trait( | |||
42 | crate::lang_item::LangItemTarget::Trait(t) => t, | 42 | crate::lang_item::LangItemTarget::Trait(t) => t, |
43 | _ => return None, | 43 | _ => return None, |
44 | }; | 44 | }; |
45 | let target = deref_trait.associated_type_by_name(db, Name::target())?; | 45 | let target = deref_trait.associated_type_by_name(db, &name::TARGET)?; |
46 | 46 | ||
47 | if target.generic_params(db).count_params_including_parent() != 1 { | 47 | if target.generic_params(db).count_params_including_parent() != 1 { |
48 | // the Target type + Deref trait should only have one generic parameter, | 48 | // the Target type + Deref trait should only have one generic parameter, |