diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/ty/infer/coerce.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/expr.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/pat.rs | 10 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/path.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/unify.rs | 12 |
5 files changed, 20 insertions, 14 deletions
diff --git a/crates/ra_hir/src/ty/infer/coerce.rs b/crates/ra_hir/src/ty/infer/coerce.rs index cf45ede7c..3fb5d8a83 100644 --- a/crates/ra_hir/src/ty/infer/coerce.rs +++ b/crates/ra_hir/src/ty/infer/coerce.rs | |||
@@ -7,6 +7,7 @@ | |||
7 | use hir_def::{ | 7 | use hir_def::{ |
8 | lang_item::LangItemTarget, | 8 | lang_item::LangItemTarget, |
9 | resolver::{HasResolver, Resolver}, | 9 | resolver::{HasResolver, Resolver}, |
10 | type_ref::Mutability, | ||
10 | AdtId, | 11 | AdtId, |
11 | }; | 12 | }; |
12 | use rustc_hash::FxHashMap; | 13 | use rustc_hash::FxHashMap; |
@@ -15,7 +16,6 @@ use test_utils::tested_by; | |||
15 | use crate::{ | 16 | use crate::{ |
16 | db::HirDatabase, | 17 | db::HirDatabase, |
17 | ty::{autoderef, Substs, TraitRef, Ty, TypeCtor, TypeWalk}, | 18 | ty::{autoderef, Substs, TraitRef, Ty, TypeCtor, TypeWalk}, |
18 | Mutability, | ||
19 | }; | 19 | }; |
20 | 20 | ||
21 | use super::{InEnvironment, InferTy, InferenceContext, TypeVarValue}; | 21 | use super::{InEnvironment, InferTy, InferenceContext, TypeVarValue}; |
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs index eb221d6bc..57f845dfa 100644 --- a/crates/ra_hir/src/ty/infer/expr.rs +++ b/crates/ra_hir/src/ty/infer/expr.rs | |||
@@ -5,22 +5,21 @@ use std::sync::Arc; | |||
5 | 5 | ||
6 | use hir_def::{ | 6 | use hir_def::{ |
7 | builtin_type::Signedness, | 7 | builtin_type::Signedness, |
8 | expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, | ||
8 | generics::GenericParams, | 9 | generics::GenericParams, |
9 | path::{GenericArg, GenericArgs}, | 10 | path::{GenericArg, GenericArgs}, |
10 | resolver::resolver_for_expr, | 11 | resolver::resolver_for_expr, |
11 | AdtId, ContainerId, Lookup, StructFieldId, | 12 | AdtId, ContainerId, Lookup, StructFieldId, |
12 | }; | 13 | }; |
13 | use hir_expand::name; | 14 | use hir_expand::name::{self, Name}; |
14 | 15 | ||
15 | use crate::{ | 16 | use crate::{ |
16 | db::HirDatabase, | 17 | db::HirDatabase, |
17 | expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, | ||
18 | ty::{ | 18 | ty::{ |
19 | autoderef, method_resolution, op, traits::InEnvironment, CallableDef, InferTy, IntTy, | 19 | autoderef, method_resolution, op, traits::InEnvironment, CallableDef, InferTy, IntTy, |
20 | Mutability, Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | 20 | Mutability, Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, |
21 | TypeWalk, Uncertain, | 21 | TypeWalk, Uncertain, |
22 | }, | 22 | }, |
23 | Name, | ||
24 | }; | 23 | }; |
25 | 24 | ||
26 | use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; | 25 | use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; |
diff --git a/crates/ra_hir/src/ty/infer/pat.rs b/crates/ra_hir/src/ty/infer/pat.rs index 641d61e87..6dbf03eb2 100644 --- a/crates/ra_hir/src/ty/infer/pat.rs +++ b/crates/ra_hir/src/ty/infer/pat.rs | |||
@@ -3,14 +3,18 @@ | |||
3 | use std::iter::repeat; | 3 | use std::iter::repeat; |
4 | use std::sync::Arc; | 4 | use std::sync::Arc; |
5 | 5 | ||
6 | use hir_def::{ | ||
7 | expr::{BindingAnnotation, Pat, PatId, RecordFieldPat}, | ||
8 | path::Path, | ||
9 | type_ref::Mutability, | ||
10 | }; | ||
11 | use hir_expand::name::Name; | ||
6 | use test_utils::tested_by; | 12 | use test_utils::tested_by; |
7 | 13 | ||
8 | use super::{BindingMode, InferenceContext}; | 14 | use super::{BindingMode, InferenceContext}; |
9 | use crate::{ | 15 | use crate::{ |
10 | db::HirDatabase, | 16 | db::HirDatabase, |
11 | expr::{BindingAnnotation, Pat, PatId, RecordFieldPat}, | 17 | ty::{Substs, Ty, TypeCtor, TypeWalk}, |
12 | ty::{Mutability, Substs, Ty, TypeCtor, TypeWalk}, | ||
13 | Name, Path, | ||
14 | }; | 18 | }; |
15 | 19 | ||
16 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { | 20 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { |
diff --git a/crates/ra_hir/src/ty/infer/path.rs b/crates/ra_hir/src/ty/infer/path.rs index be2067dd4..8d8b56d2d 100644 --- a/crates/ra_hir/src/ty/infer/path.rs +++ b/crates/ra_hir/src/ty/infer/path.rs | |||
@@ -1,14 +1,15 @@ | |||
1 | //! Path expression resolution. | 1 | //! Path expression resolution. |
2 | 2 | ||
3 | use hir_def::{ | 3 | use hir_def::{ |
4 | path::PathSegment, | 4 | path::{Path, PathSegment}, |
5 | resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, | 5 | resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, |
6 | }; | 6 | }; |
7 | use hir_expand::name::Name; | ||
7 | 8 | ||
8 | use crate::{ | 9 | use crate::{ |
9 | db::HirDatabase, | 10 | db::HirDatabase, |
10 | ty::{method_resolution, Substs, Ty, TypeWalk, ValueTyDefId}, | 11 | ty::{method_resolution, Substs, Ty, TypeWalk, ValueTyDefId}, |
11 | AssocItem, Container, Function, Name, Path, | 12 | AssocItem, Container, Function, |
12 | }; | 13 | }; |
13 | 14 | ||
14 | use super::{ExprOrPatId, InferenceContext, TraitRef}; | 15 | use super::{ExprOrPatId, InferenceContext, TraitRef}; |
diff --git a/crates/ra_hir/src/ty/infer/unify.rs b/crates/ra_hir/src/ty/infer/unify.rs index 64d9394cf..e27bb2f82 100644 --- a/crates/ra_hir/src/ty/infer/unify.rs +++ b/crates/ra_hir/src/ty/infer/unify.rs | |||
@@ -1,12 +1,14 @@ | |||
1 | //! Unification and canonicalization logic. | 1 | //! Unification and canonicalization logic. |
2 | 2 | ||
3 | use super::{InferenceContext, Obligation}; | 3 | use super::{InferenceContext, Obligation}; |
4 | use crate::db::HirDatabase; | 4 | use crate::{ |
5 | use crate::ty::{ | 5 | db::HirDatabase, |
6 | Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, | 6 | ty::{ |
7 | TypeWalk, | 7 | Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, |
8 | TypeWalk, | ||
9 | }, | ||
10 | util::make_mut_slice, | ||
8 | }; | 11 | }; |
9 | use crate::util::make_mut_slice; | ||
10 | 12 | ||
11 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { | 13 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { |
12 | pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D> | 14 | pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D> |