aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-11 14:22:06 +0000
committerAleksey Kladov <[email protected]>2019-11-11 14:22:06 +0000
commitff609cc49715571324b72d2bda60d56878466640 (patch)
treef788fa0814921d2d0a16b5f2dc4cfc1f829c69cd /crates/ra_hir
parenta599147b4232c0d4f6b071a3a96e86f903f4cf52 (diff)
Don't reexport generics from HIR
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/lib.rs4
-rw-r--r--crates/ra_hir/src/ty.rs12
-rw-r--r--crates/ra_hir/src/ty/autoderef.rs2
-rw-r--r--crates/ra_hir/src/ty/infer/path.rs3
-rw-r--r--crates/ra_hir/src/ty/traits/chalk.rs4
5 files changed, 13 insertions, 12 deletions
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index 806f1daed..125c4b289 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -39,7 +39,7 @@ mod ty;
39mod impl_block; 39mod impl_block;
40mod expr; 40mod expr;
41mod lang_item; 41mod lang_item;
42mod generics; 42pub mod generics;
43mod resolve; 43mod resolve;
44pub mod diagnostics; 44pub mod diagnostics;
45mod util; 45mod util;
@@ -70,7 +70,7 @@ pub use crate::{
70 }, 70 },
71 expr::ExprScopes, 71 expr::ExprScopes,
72 from_source::FromSource, 72 from_source::FromSource,
73 generics::{GenericDef, GenericParam, GenericParams, HasGenericParams}, 73 generics::GenericDef,
74 ids::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile}, 74 ids::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile},
75 impl_block::ImplBlock, 75 impl_block::ImplBlock,
76 resolve::ScopeDef, 76 resolve::ScopeDef,
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index cd2ac0e8b..6f24cfad6 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -17,8 +17,11 @@ use std::sync::Arc;
17use std::{fmt, iter, mem}; 17use std::{fmt, iter, mem};
18 18
19use crate::{ 19use crate::{
20 db::HirDatabase, expr::ExprId, util::make_mut_slice, Adt, Crate, DefWithBody, GenericParams, 20 db::HirDatabase,
21 HasGenericParams, Mutability, Name, Trait, TypeAlias, 21 expr::ExprId,
22 generics::{GenericParams, HasGenericParams},
23 util::make_mut_slice,
24 Adt, Crate, DefWithBody, Mutability, Name, Trait, TypeAlias,
22}; 25};
23use display::{HirDisplay, HirFormatter}; 26use display::{HirDisplay, HirFormatter};
24 27
@@ -342,10 +345,7 @@ impl Substs {
342 ) 345 )
343 } 346 }
344 347
345 pub fn build_for_def( 348 pub fn build_for_def(db: &impl HirDatabase, def: impl HasGenericParams) -> SubstsBuilder {
346 db: &impl HirDatabase,
347 def: impl crate::HasGenericParams,
348 ) -> SubstsBuilder {
349 let params = def.generic_params(db); 349 let params = def.generic_params(db);
350 let param_count = params.count_params_including_parent(); 350 let param_count = params.count_params_including_parent();
351 Substs::builder(param_count) 351 Substs::builder(param_count)
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs
index 3645ee831..872a4517d 100644
--- a/crates/ra_hir/src/ty/autoderef.rs
+++ b/crates/ra_hir/src/ty/autoderef.rs
@@ -9,7 +9,7 @@ use hir_expand::name;
9use log::{info, warn}; 9use log::{info, warn};
10 10
11use super::{traits::Solution, Canonical, Substs, Ty, TypeWalk}; 11use super::{traits::Solution, Canonical, Substs, Ty, TypeWalk};
12use crate::{db::HirDatabase, HasGenericParams, Resolver}; 12use crate::{db::HirDatabase, generics::HasGenericParams, Resolver};
13 13
14const AUTODEREF_RECURSION_LIMIT: usize = 10; 14const AUTODEREF_RECURSION_LIMIT: usize = 10;
15 15
diff --git a/crates/ra_hir/src/ty/infer/path.rs b/crates/ra_hir/src/ty/infer/path.rs
index 865ced5a1..31ca675aa 100644
--- a/crates/ra_hir/src/ty/infer/path.rs
+++ b/crates/ra_hir/src/ty/infer/path.rs
@@ -5,9 +5,10 @@ use hir_def::path::PathSegment;
5use super::{ExprOrPatId, InferenceContext, TraitRef}; 5use super::{ExprOrPatId, InferenceContext, TraitRef};
6use crate::{ 6use crate::{
7 db::HirDatabase, 7 db::HirDatabase,
8 generics::HasGenericParams,
8 resolve::{ResolveValueResult, Resolver, TypeNs, ValueNs}, 9 resolve::{ResolveValueResult, Resolver, TypeNs, ValueNs},
9 ty::{method_resolution, Namespace, Substs, Ty, TypableDef, TypeWalk}, 10 ty::{method_resolution, Namespace, Substs, Ty, TypableDef, TypeWalk},
10 AssocItem, Container, HasGenericParams, Name, Path, 11 AssocItem, Container, Name, Path,
11}; 12};
12 13
13impl<'a, D: HirDatabase> InferenceContext<'a, D> { 14impl<'a, D: HirDatabase> InferenceContext<'a, D> {
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs
index c694952f3..14c54b9fb 100644
--- a/crates/ra_hir/src/ty/traits/chalk.rs
+++ b/crates/ra_hir/src/ty/traits/chalk.rs
@@ -16,13 +16,13 @@ use ra_db::salsa::{InternId, InternKey};
16use super::{Canonical, ChalkContext, Impl, Obligation}; 16use super::{Canonical, ChalkContext, Impl, Obligation};
17use crate::{ 17use crate::{
18 db::HirDatabase, 18 db::HirDatabase,
19 generics::GenericDef, 19 generics::{GenericDef, HasGenericParams},
20 ty::display::HirDisplay, 20 ty::display::HirDisplay,
21 ty::{ 21 ty::{
22 ApplicationTy, GenericPredicate, Namespace, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, 22 ApplicationTy, GenericPredicate, Namespace, ProjectionTy, Substs, TraitRef, Ty, TypeCtor,
23 TypeWalk, 23 TypeWalk,
24 }, 24 },
25 AssocItem, Crate, HasGenericParams, ImplBlock, Trait, TypeAlias, 25 AssocItem, Crate, ImplBlock, Trait, TypeAlias,
26}; 26};
27 27
28/// This represents a trait whose name we could not resolve. 28/// This represents a trait whose name we could not resolve.