From e91ebfc752bdfa8fc20be6ea97a14aa6a4d897ae Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 27 Nov 2019 12:13:07 +0300 Subject: Cleanup imports --- crates/ra_hir/src/ty/infer/coerce.rs | 2 +- crates/ra_hir/src/ty/infer/expr.rs | 5 ++--- crates/ra_hir/src/ty/infer/pat.rs | 10 +++++++--- crates/ra_hir/src/ty/infer/path.rs | 5 +++-- crates/ra_hir/src/ty/infer/unify.rs | 12 +++++++----- 5 files changed, 20 insertions(+), 14 deletions(-) (limited to 'crates/ra_hir/src') 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 @@ use hir_def::{ lang_item::LangItemTarget, resolver::{HasResolver, Resolver}, + type_ref::Mutability, AdtId, }; use rustc_hash::FxHashMap; @@ -15,7 +16,6 @@ use test_utils::tested_by; use crate::{ db::HirDatabase, ty::{autoderef, Substs, TraitRef, Ty, TypeCtor, TypeWalk}, - Mutability, }; 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; use hir_def::{ builtin_type::Signedness, + expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, generics::GenericParams, path::{GenericArg, GenericArgs}, resolver::resolver_for_expr, AdtId, ContainerId, Lookup, StructFieldId, }; -use hir_expand::name; +use hir_expand::name::{self, Name}; use crate::{ db::HirDatabase, - expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, ty::{ autoderef, method_resolution, op, traits::InEnvironment, CallableDef, InferTy, IntTy, Mutability, Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk, Uncertain, }, - Name, }; 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 @@ use std::iter::repeat; 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 super::{BindingMode, InferenceContext}; use crate::{ db::HirDatabase, - expr::{BindingAnnotation, Pat, PatId, RecordFieldPat}, - ty::{Mutability, Substs, Ty, TypeCtor, TypeWalk}, - Name, Path, + ty::{Substs, Ty, TypeCtor, TypeWalk}, }; 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 @@ //! Path expression resolution. use hir_def::{ - path::PathSegment, + path::{Path, PathSegment}, resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, }; +use hir_expand::name::Name; use crate::{ db::HirDatabase, ty::{method_resolution, Substs, Ty, TypeWalk, ValueTyDefId}, - AssocItem, Container, Function, Name, Path, + AssocItem, Container, Function, }; 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 @@ //! Unification and canonicalization logic. use super::{InferenceContext, Obligation}; -use crate::db::HirDatabase; -use crate::ty::{ - Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, - TypeWalk, +use crate::{ + db::HirDatabase, + ty::{ + 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> { pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D> -- cgit v1.2.3