Cleanup imports

This commit is contained in:
Aleksey Kladov 2019-11-27 12:13:07 +03:00
parent 3a0929fca7
commit e91ebfc752
5 changed files with 20 additions and 14 deletions

View file

@ -7,6 +7,7 @@
use hir_def::{ use hir_def::{
lang_item::LangItemTarget, lang_item::LangItemTarget,
resolver::{HasResolver, Resolver}, resolver::{HasResolver, Resolver},
type_ref::Mutability,
AdtId, AdtId,
}; };
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
@ -15,7 +16,6 @@ use test_utils::tested_by;
use crate::{ use crate::{
db::HirDatabase, db::HirDatabase,
ty::{autoderef, Substs, TraitRef, Ty, TypeCtor, TypeWalk}, ty::{autoderef, Substs, TraitRef, Ty, TypeCtor, TypeWalk},
Mutability,
}; };
use super::{InEnvironment, InferTy, InferenceContext, TypeVarValue}; use super::{InEnvironment, InferTy, InferenceContext, TypeVarValue};

View file

@ -5,22 +5,21 @@ use std::sync::Arc;
use hir_def::{ use hir_def::{
builtin_type::Signedness, builtin_type::Signedness,
expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp},
generics::GenericParams, generics::GenericParams,
path::{GenericArg, GenericArgs}, path::{GenericArg, GenericArgs},
resolver::resolver_for_expr, resolver::resolver_for_expr,
AdtId, ContainerId, Lookup, StructFieldId, AdtId, ContainerId, Lookup, StructFieldId,
}; };
use hir_expand::name; use hir_expand::name::{self, Name};
use crate::{ use crate::{
db::HirDatabase, db::HirDatabase,
expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp},
ty::{ ty::{
autoderef, method_resolution, op, traits::InEnvironment, CallableDef, InferTy, IntTy, autoderef, method_resolution, op, traits::InEnvironment, CallableDef, InferTy, IntTy,
Mutability, Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, Mutability, Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor,
TypeWalk, Uncertain, TypeWalk, Uncertain,
}, },
Name,
}; };
use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch};

View file

@ -3,14 +3,18 @@
use std::iter::repeat; use std::iter::repeat;
use std::sync::Arc; use std::sync::Arc;
use hir_def::{
expr::{BindingAnnotation, Pat, PatId, RecordFieldPat},
path::Path,
type_ref::Mutability,
};
use hir_expand::name::Name;
use test_utils::tested_by; use test_utils::tested_by;
use super::{BindingMode, InferenceContext}; use super::{BindingMode, InferenceContext};
use crate::{ use crate::{
db::HirDatabase, db::HirDatabase,
expr::{BindingAnnotation, Pat, PatId, RecordFieldPat}, ty::{Substs, Ty, TypeCtor, TypeWalk},
ty::{Mutability, Substs, Ty, TypeCtor, TypeWalk},
Name, Path,
}; };
impl<'a, D: HirDatabase> InferenceContext<'a, D> { impl<'a, D: HirDatabase> InferenceContext<'a, D> {

View file

@ -1,14 +1,15 @@
//! Path expression resolution. //! Path expression resolution.
use hir_def::{ use hir_def::{
path::PathSegment, path::{Path, PathSegment},
resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs},
}; };
use hir_expand::name::Name;
use crate::{ use crate::{
db::HirDatabase, db::HirDatabase,
ty::{method_resolution, Substs, Ty, TypeWalk, ValueTyDefId}, ty::{method_resolution, Substs, Ty, TypeWalk, ValueTyDefId},
AssocItem, Container, Function, Name, Path, AssocItem, Container, Function,
}; };
use super::{ExprOrPatId, InferenceContext, TraitRef}; use super::{ExprOrPatId, InferenceContext, TraitRef};

View file

@ -1,12 +1,14 @@
//! Unification and canonicalization logic. //! Unification and canonicalization logic.
use super::{InferenceContext, Obligation}; use super::{InferenceContext, Obligation};
use crate::db::HirDatabase; use crate::{
use crate::ty::{ db::HirDatabase,
Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, ty::{
TypeWalk, Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty,
TypeWalk,
},
util::make_mut_slice,
}; };
use crate::util::make_mut_slice;
impl<'a, D: HirDatabase> InferenceContext<'a, D> { impl<'a, D: HirDatabase> InferenceContext<'a, D> {
pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D> pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D>