diff options
author | Aleksey Kladov <[email protected]> | 2019-12-07 10:50:36 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-07 12:05:56 +0000 |
commit | 8e9837df21942ca12a5aece0a868ea46eb405742 (patch) | |
tree | 664cfafc63c0895d76df5c85f6f10c0739f82275 /crates/ra_hir_ty/src/autoderef.rs | |
parent | 30fefcc08cc0c670ce541476491238d258ca55c1 (diff) |
Remove idx and parent generics from generics
This makes `hir_def::GenericParams` flatter. The logic for
re-numbering the params is moved to hir instead.
Diffstat (limited to 'crates/ra_hir_ty/src/autoderef.rs')
-rw-r--r-- | crates/ra_hir_ty/src/autoderef.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/autoderef.rs b/crates/ra_hir_ty/src/autoderef.rs index 9d1d4e48c..a6db7f623 100644 --- a/crates/ra_hir_ty/src/autoderef.rs +++ b/crates/ra_hir_ty/src/autoderef.rs | |||
@@ -10,10 +10,10 @@ use hir_expand::name; | |||
10 | use log::{info, warn}; | 10 | use log::{info, warn}; |
11 | use ra_db::CrateId; | 11 | use ra_db::CrateId; |
12 | 12 | ||
13 | use crate::db::HirDatabase; | 13 | use crate::{ |
14 | 14 | db::HirDatabase, | |
15 | use super::{ | ||
16 | traits::{InEnvironment, Solution}, | 15 | traits::{InEnvironment, Solution}, |
16 | utils::generics, | ||
17 | Canonical, Substs, Ty, TypeWalk, | 17 | Canonical, Substs, Ty, TypeWalk, |
18 | }; | 18 | }; |
19 | 19 | ||
@@ -54,7 +54,7 @@ fn deref_by_trait( | |||
54 | }; | 54 | }; |
55 | let target = db.trait_data(deref_trait).associated_type_by_name(&name::TARGET_TYPE)?; | 55 | let target = db.trait_data(deref_trait).associated_type_by_name(&name::TARGET_TYPE)?; |
56 | 56 | ||
57 | let generic_params = db.generic_params(target.into()); | 57 | let generic_params = generics(db, target.into()); |
58 | if generic_params.count_params_including_parent() != 1 { | 58 | if generic_params.count_params_including_parent() != 1 { |
59 | // the Target type + Deref trait should only have one generic parameter, | 59 | // the Target type + Deref trait should only have one generic parameter, |
60 | // namely Deref's Self type | 60 | // namely Deref's Self type |