diff options
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/expr.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/path.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/lower.rs | 3 |
4 files changed, 11 insertions, 7 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 92b8e718e..05c6b5aad 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -21,7 +21,7 @@ use std::sync::Arc; | |||
21 | use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; | 21 | use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; |
22 | use rustc_hash::FxHashMap; | 22 | use rustc_hash::FxHashMap; |
23 | 23 | ||
24 | use hir_def::name; | 24 | use hir_def::{name, path::known}; |
25 | use ra_arena::map::ArenaMap; | 25 | use ra_arena::map::ArenaMap; |
26 | use ra_prof::profile; | 26 | use ra_prof::profile; |
27 | use test_utils::tested_by; | 27 | use test_utils::tested_by; |
@@ -38,7 +38,6 @@ use crate::{ | |||
38 | db::HirDatabase, | 38 | db::HirDatabase, |
39 | diagnostics::DiagnosticSink, | 39 | diagnostics::DiagnosticSink, |
40 | expr::{BindingAnnotation, Body, ExprId, PatId}, | 40 | expr::{BindingAnnotation, Body, ExprId, PatId}, |
41 | path::known, | ||
42 | resolve::{Resolver, TypeNs}, | 41 | resolve::{Resolver, TypeNs}, |
43 | ty::infer::diagnostics::InferenceDiagnostic, | 42 | ty::infer::diagnostics::InferenceDiagnostic, |
44 | type_ref::{Mutability, TypeRef}, | 43 | type_ref::{Mutability, TypeRef}, |
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs index 7ef87bfe2..bc6437b44 100644 --- a/crates/ra_hir/src/ty/infer/expr.rs +++ b/crates/ra_hir/src/ty/infer/expr.rs | |||
@@ -3,7 +3,10 @@ | |||
3 | use std::iter::{repeat, repeat_with}; | 3 | use std::iter::{repeat, repeat_with}; |
4 | use std::sync::Arc; | 4 | use std::sync::Arc; |
5 | 5 | ||
6 | use hir_def::name; | 6 | use hir_def::{ |
7 | name, | ||
8 | path::{GenericArg, GenericArgs}, | ||
9 | }; | ||
7 | 10 | ||
8 | use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; | 11 | use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; |
9 | use crate::{ | 12 | use crate::{ |
@@ -11,7 +14,6 @@ use crate::{ | |||
11 | expr::{self, Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, | 14 | expr::{self, Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, |
12 | generics::{GenericParams, HasGenericParams}, | 15 | generics::{GenericParams, HasGenericParams}, |
13 | nameres::Namespace, | 16 | nameres::Namespace, |
14 | path::{GenericArg, GenericArgs}, | ||
15 | ty::{ | 17 | ty::{ |
16 | autoderef, method_resolution, op, primitive, CallableDef, InferTy, Mutability, Obligation, | 18 | autoderef, method_resolution, op, primitive, CallableDef, InferTy, Mutability, Obligation, |
17 | ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk, | 19 | ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk, |
diff --git a/crates/ra_hir/src/ty/infer/path.rs b/crates/ra_hir/src/ty/infer/path.rs index db979353a..77aa35ce1 100644 --- a/crates/ra_hir/src/ty/infer/path.rs +++ b/crates/ra_hir/src/ty/infer/path.rs | |||
@@ -1,5 +1,7 @@ | |||
1 | //! Path expression resolution. | 1 | //! Path expression resolution. |
2 | 2 | ||
3 | use hir_def::path::PathSegment; | ||
4 | |||
3 | use super::{ExprOrPatId, InferenceContext, TraitRef}; | 5 | use super::{ExprOrPatId, InferenceContext, TraitRef}; |
4 | use crate::{ | 6 | use crate::{ |
5 | db::HirDatabase, | 7 | db::HirDatabase, |
@@ -131,7 +133,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
131 | fn resolve_trait_assoc_item( | 133 | fn resolve_trait_assoc_item( |
132 | &mut self, | 134 | &mut self, |
133 | trait_ref: TraitRef, | 135 | trait_ref: TraitRef, |
134 | segment: &crate::path::PathSegment, | 136 | segment: &PathSegment, |
135 | id: ExprOrPatId, | 137 | id: ExprOrPatId, |
136 | ) -> Option<(ValueNs, Option<Substs>)> { | 138 | ) -> Option<(ValueNs, Option<Substs>)> { |
137 | let trait_ = trait_ref.trait_; | 139 | let trait_ = trait_ref.trait_; |
@@ -170,7 +172,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
170 | fn resolve_ty_assoc_item( | 172 | fn resolve_ty_assoc_item( |
171 | &mut self, | 173 | &mut self, |
172 | ty: Ty, | 174 | ty: Ty, |
173 | segment: &crate::path::PathSegment, | 175 | segment: &PathSegment, |
174 | id: ExprOrPatId, | 176 | id: ExprOrPatId, |
175 | ) -> Option<(ValueNs, Option<Substs>)> { | 177 | ) -> Option<(ValueNs, Option<Substs>)> { |
176 | if let Ty::Unknown = ty { | 178 | if let Ty::Unknown = ty { |
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index 366556134..b131b306c 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs | |||
@@ -8,6 +8,8 @@ | |||
8 | use std::iter; | 8 | use std::iter; |
9 | use std::sync::Arc; | 9 | use std::sync::Arc; |
10 | 10 | ||
11 | use hir_def::path::{GenericArg, PathSegment}; | ||
12 | |||
11 | use super::{ | 13 | use super::{ |
12 | FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | 14 | FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, |
13 | TypeWalk, | 15 | TypeWalk, |
@@ -18,7 +20,6 @@ use crate::{ | |||
18 | generics::HasGenericParams, | 20 | generics::HasGenericParams, |
19 | generics::{GenericDef, WherePredicate}, | 21 | generics::{GenericDef, WherePredicate}, |
20 | nameres::Namespace, | 22 | nameres::Namespace, |
21 | path::{GenericArg, PathSegment}, | ||
22 | resolve::{Resolver, TypeNs}, | 23 | resolve::{Resolver, TypeNs}, |
23 | ty::Adt, | 24 | ty::Adt, |
24 | type_ref::{TypeBound, TypeRef}, | 25 | type_ref::{TypeBound, TypeRef}, |