From e5300ad3baf80c9903235a98a12b6cfd409e9f10 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 30 Oct 2019 17:28:30 +0300 Subject: remove forward pointer for type_ref --- crates/ra_hir/src/adt.rs | 3 +-- crates/ra_hir/src/code_model.rs | 3 +-- crates/ra_hir/src/expr.rs | 6 ++++-- crates/ra_hir/src/expr/lower.rs | 2 +- crates/ra_hir/src/generics.rs | 2 +- crates/ra_hir/src/impl_block.rs | 2 +- crates/ra_hir/src/lib.rs | 3 +-- crates/ra_hir/src/ty.rs | 4 ++-- crates/ra_hir/src/ty/infer.rs | 7 +++++-- crates/ra_hir/src/ty/infer/coerce.rs | 3 +-- crates/ra_hir/src/ty/lower.rs | 6 ++++-- crates/ra_hir/src/ty/method_resolution.rs | 3 +-- crates/ra_hir/src/type_alias.rs | 6 ++++-- crates/ra_hir/src/type_ref.rs | 1 - 14 files changed, 27 insertions(+), 24 deletions(-) delete mode 100644 crates/ra_hir/src/type_ref.rs (limited to 'crates') diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs index ce64980bb..d16b3a1cc 100644 --- a/crates/ra_hir/src/adt.rs +++ b/crates/ra_hir/src/adt.rs @@ -3,13 +3,12 @@ use std::sync::Arc; -use hir_def::name::AsName; +use hir_def::{name::AsName, type_ref::TypeRef}; use ra_arena::{impl_arena_id, Arena, RawId}; use ra_syntax::ast::{self, NameOwner, StructKind, TypeAscriptionOwner}; use crate::{ db::{AstDatabase, DefDatabase, HirDatabase}, - type_ref::TypeRef, Enum, EnumVariant, FieldSource, HasSource, Module, Name, Source, Struct, StructField, }; diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 7848d0a3f..d865c972e 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -10,6 +10,7 @@ use hir_def::{ self, AsName, BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, SELF_TYPE, STR, U128, U16, U32, U64, U8, USIZE, }, + type_ref::{Mutability, TypeRef}, CrateModuleId, ModuleId, }; use ra_db::{CrateId, Edition}; @@ -33,8 +34,6 @@ use crate::{ primitive::{FloatBitness, FloatTy, IntBitness, IntTy, Signedness}, InferenceResult, TraitRef, }, - type_ref::Mutability, - type_ref::TypeRef, Either, HasSource, Name, Ty, }; diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 31857ad56..6e23197a4 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs @@ -6,7 +6,10 @@ pub(crate) mod validation; use std::{ops::Index, sync::Arc}; -use hir_def::path::GenericArgs; +use hir_def::{ + path::GenericArgs, + type_ref::{Mutability, TypeRef}, +}; use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; use ra_syntax::{ast, AstPtr}; use rustc_hash::FxHashMap; @@ -14,7 +17,6 @@ use rustc_hash::FxHashMap; use crate::{ db::HirDatabase, ty::primitive::{UncertainFloatTy, UncertainIntTy}, - type_ref::{Mutability, TypeRef}, DefWithBody, Either, HasSource, Name, Path, Resolver, Source, }; diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs index 6436c3a24..ad029b868 100644 --- a/crates/ra_hir/src/expr/lower.rs +++ b/crates/ra_hir/src/expr/lower.rs @@ -3,6 +3,7 @@ use hir_def::{ name::{self, AsName, Name}, path::GenericArgs, + type_ref::TypeRef, }; use ra_arena::Arena; use ra_syntax::{ @@ -17,7 +18,6 @@ use test_utils::tested_by; use crate::{ db::HirDatabase, ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, - type_ref::TypeRef, AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver, Source, }; diff --git a/crates/ra_hir/src/generics.rs b/crates/ra_hir/src/generics.rs index 45f9713a0..9d5d18564 100644 --- a/crates/ra_hir/src/generics.rs +++ b/crates/ra_hir/src/generics.rs @@ -8,12 +8,12 @@ use std::sync::Arc; use hir_def::{ name::{self, AsName}, path::Path, + type_ref::{TypeBound, TypeRef}, }; use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, TypeParamsOwner}; use crate::{ db::{AstDatabase, DefDatabase, HirDatabase}, - type_ref::{TypeBound, TypeRef}, Adt, Const, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, Trait, TypeAlias, Union, }; diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 06f21fc33..8584686fd 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs @@ -3,6 +3,7 @@ use rustc_hash::FxHashMap; use std::sync::Arc; +use hir_def::type_ref::TypeRef; use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; use ra_cfg::CfgOptions; use ra_syntax::{ @@ -19,7 +20,6 @@ use crate::{ ids::MacroCallLoc, resolve::Resolver, ty::Ty, - type_ref::TypeRef, AssocItem, AstId, Const, Function, HasSource, HirFileId, MacroFileKind, Path, Source, TraitRef, TypeAlias, }; diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index e723a1f40..4dd99c74f 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -39,7 +39,6 @@ mod nameres; mod adt; mod traits; mod type_alias; -mod type_ref; mod ty; mod attr; mod impl_block; @@ -75,7 +74,6 @@ pub use crate::{ ty::{ display::HirDisplay, ApplicationTy, CallableDef, Substs, TraitRef, Ty, TypeCtor, TypeWalk, }, - type_ref::Mutability, }; pub use self::code_model::{ @@ -89,4 +87,5 @@ pub use self::code_model::{ pub use hir_def::{ name::Name, path::{Path, PathKind}, + type_ref::Mutability, }; diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index cc9746f6d..d2bfcdc7d 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -17,8 +17,8 @@ use std::sync::Arc; use std::{fmt, iter, mem}; use crate::{ - db::HirDatabase, expr::ExprId, type_ref::Mutability, util::make_mut_slice, Adt, Crate, - DefWithBody, GenericParams, HasGenericParams, Name, Trait, TypeAlias, + db::HirDatabase, expr::ExprId, util::make_mut_slice, Adt, Crate, DefWithBody, GenericParams, + HasGenericParams, Mutability, Name, Trait, TypeAlias, }; use display::{HirDisplay, HirFormatter}; diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 05c6b5aad..7466ee341 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -21,7 +21,11 @@ use std::sync::Arc; use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; use rustc_hash::FxHashMap; -use hir_def::{name, path::known}; +use hir_def::{ + name, + path::known, + type_ref::{Mutability, TypeRef}, +}; use ra_arena::map::ArenaMap; use ra_prof::profile; use test_utils::tested_by; @@ -40,7 +44,6 @@ use crate::{ expr::{BindingAnnotation, Body, ExprId, PatId}, resolve::{Resolver, TypeNs}, ty::infer::diagnostics::InferenceDiagnostic, - type_ref::{Mutability, TypeRef}, Adt, AssocItem, ConstData, DefWithBody, FnData, Function, HasBody, Path, StructField, }; diff --git a/crates/ra_hir/src/ty/infer/coerce.rs b/crates/ra_hir/src/ty/infer/coerce.rs index 0429a9866..6ea135126 100644 --- a/crates/ra_hir/src/ty/infer/coerce.rs +++ b/crates/ra_hir/src/ty/infer/coerce.rs @@ -14,8 +14,7 @@ use crate::{ lang_item::LangItemTarget, resolve::Resolver, ty::{autoderef, Substs, Ty, TypeCtor, TypeWalk}, - type_ref::Mutability, - Adt, + Adt, Mutability, }; impl<'a, D: HirDatabase> InferenceContext<'a, D> { diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index b131b306c..0f49a0e54 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs @@ -8,7 +8,10 @@ use std::iter; use std::sync::Arc; -use hir_def::path::{GenericArg, PathSegment}; +use hir_def::{ + path::{GenericArg, PathSegment}, + type_ref::{TypeBound, TypeRef}, +}; use super::{ FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, @@ -22,7 +25,6 @@ use crate::{ nameres::Namespace, resolve::{Resolver, TypeNs}, ty::Adt, - type_ref::{TypeBound, TypeRef}, util::make_mut_slice, BuiltinType, Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField, Trait, TypeAlias, Union, diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index 50583a142..eb69344f6 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs @@ -15,8 +15,7 @@ use crate::{ resolve::Resolver, ty::primitive::{FloatBitness, UncertainFloatTy, UncertainIntTy}, ty::{Ty, TypeCtor}, - type_ref::Mutability, - AssocItem, Crate, Function, Module, Name, Trait, + AssocItem, Crate, Function, Module, Mutability, Name, Trait, }; /// This is used as a key for indexing impls. diff --git a/crates/ra_hir/src/type_alias.rs b/crates/ra_hir/src/type_alias.rs index 18c01e1b9..87126ee7f 100644 --- a/crates/ra_hir/src/type_alias.rs +++ b/crates/ra_hir/src/type_alias.rs @@ -2,12 +2,14 @@ use std::sync::Arc; -use hir_def::name::{AsName, Name}; +use hir_def::{ + name::{AsName, Name}, + type_ref::TypeRef, +}; use ra_syntax::ast::NameOwner; use crate::{ db::{AstDatabase, DefDatabase}, - type_ref::TypeRef, HasSource, TypeAlias, }; diff --git a/crates/ra_hir/src/type_ref.rs b/crates/ra_hir/src/type_ref.rs deleted file mode 100644 index bd56ddbe6..000000000 --- a/crates/ra_hir/src/type_ref.rs +++ /dev/null @@ -1 +0,0 @@ -pub use hir_def::type_ref::*; -- cgit v1.2.3