remove forward pointer to Path

This commit is contained in:
Aleksey Kladov 2019-10-30 17:24:36 +03:00
parent f8ddef875a
commit e564334320
12 changed files with 27 additions and 20 deletions

View File

@ -6,13 +6,13 @@ pub(crate) mod validation;
use std::{ops::Index, sync::Arc};
use hir_def::path::GenericArgs;
use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId};
use ra_syntax::{ast, AstPtr};
use rustc_hash::FxHashMap;
use crate::{
db::HirDatabase,
path::GenericArgs,
ty::primitive::{UncertainFloatTy, UncertainIntTy},
type_ref::{Mutability, TypeRef},
DefWithBody, Either, HasSource, Name, Path, Resolver, Source,

View File

@ -1,6 +1,9 @@
//! FIXME: write short doc here
use hir_def::name::{self, AsName, Name};
use hir_def::{
name::{self, AsName, Name},
path::GenericArgs,
};
use ra_arena::Arena;
use ra_syntax::{
ast::{
@ -13,7 +16,6 @@ use test_utils::tested_by;
use crate::{
db::HirDatabase,
path::GenericArgs,
ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy},
type_ref::TypeRef,
AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver,

View File

@ -2,6 +2,7 @@
use std::sync::Arc;
use hir_def::path::known;
use ra_syntax::ast;
use rustc_hash::FxHashSet;
@ -9,7 +10,6 @@ use crate::{
db::HirDatabase,
diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr},
expr::AstPtr,
path::known,
ty::{ApplicationTy, InferenceResult, Ty, TypeCtor},
Adt, Function, Name, Path,
};

View File

@ -5,12 +5,14 @@
use std::sync::Arc;
use hir_def::name::{self, AsName};
use hir_def::{
name::{self, AsName},
path::Path,
};
use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, TypeParamsOwner};
use crate::{
db::{AstDatabase, DefDatabase, HirDatabase},
path::Path,
type_ref::{TypeBound, TypeRef},
Adt, Const, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, Trait,
TypeAlias, Union,

View File

@ -32,7 +32,6 @@ pub mod debug;
pub mod db;
#[macro_use]
pub mod mock;
mod path;
pub mod source_binder;
mod ids;
@ -71,7 +70,6 @@ pub use crate::{
ids::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile},
impl_block::ImplBlock,
nameres::{ImportId, Namespace, PerNs},
path::{Path, PathKind},
resolve::ScopeDef,
source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer},
ty::{
@ -88,4 +86,7 @@ pub use self::code_model::{
ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union,
};
pub use hir_def::name::Name;
pub use hir_def::{
name::Name,
path::{Path, PathKind},
};

View File

@ -1 +0,0 @@
pub use hir_def::path::*;

View File

@ -3,6 +3,7 @@ use std::sync::Arc;
use hir_def::{
name::{self, Name},
path::{Path, PathKind},
CrateModuleId,
};
use rustc_hash::FxHashSet;
@ -17,7 +18,6 @@ use crate::{
generics::GenericParams,
impl_block::ImplBlock,
nameres::{CrateDefMap, PerNs},
path::{Path, PathKind},
Adt, BuiltinType, Const, Enum, EnumVariant, Function, MacroDef, ModuleDef, Static, Struct,
Trait, TypeAlias,
};

View File

@ -7,7 +7,7 @@
//! purely for "IDE needs".
use std::sync::Arc;
use hir_def::name::AsName;
use hir_def::{name::AsName, path::known};
use ra_db::FileId;
use ra_syntax::{
ast::{self, AstNode},
@ -25,7 +25,6 @@ use crate::{
BodySourceMap,
},
ids::LocationCtx,
path::known,
resolve::{ScopeDef, TypeNs, ValueNs},
ty::method_resolution::implements_trait,
Const, DefWithBody, Either, Enum, FromSource, Function, HasBody, HirFileId, MacroDef, Module,

View File

@ -21,7 +21,7 @@ use std::sync::Arc;
use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue};
use rustc_hash::FxHashMap;
use hir_def::name;
use hir_def::{name, path::known};
use ra_arena::map::ArenaMap;
use ra_prof::profile;
use test_utils::tested_by;
@ -38,7 +38,6 @@ use crate::{
db::HirDatabase,
diagnostics::DiagnosticSink,
expr::{BindingAnnotation, Body, ExprId, PatId},
path::known,
resolve::{Resolver, TypeNs},
ty::infer::diagnostics::InferenceDiagnostic,
type_ref::{Mutability, TypeRef},

View File

@ -3,7 +3,10 @@
use std::iter::{repeat, repeat_with};
use std::sync::Arc;
use hir_def::name;
use hir_def::{
name,
path::{GenericArg, GenericArgs},
};
use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch};
use crate::{
@ -11,7 +14,6 @@ use crate::{
expr::{self, Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp},
generics::{GenericParams, HasGenericParams},
nameres::Namespace,
path::{GenericArg, GenericArgs},
ty::{
autoderef, method_resolution, op, primitive, CallableDef, InferTy, Mutability, Obligation,
ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk,

View File

@ -1,5 +1,7 @@
//! Path expression resolution.
use hir_def::path::PathSegment;
use super::{ExprOrPatId, InferenceContext, TraitRef};
use crate::{
db::HirDatabase,
@ -131,7 +133,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
fn resolve_trait_assoc_item(
&mut self,
trait_ref: TraitRef,
segment: &crate::path::PathSegment,
segment: &PathSegment,
id: ExprOrPatId,
) -> Option<(ValueNs, Option<Substs>)> {
let trait_ = trait_ref.trait_;
@ -170,7 +172,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
fn resolve_ty_assoc_item(
&mut self,
ty: Ty,
segment: &crate::path::PathSegment,
segment: &PathSegment,
id: ExprOrPatId,
) -> Option<(ValueNs, Option<Substs>)> {
if let Ty::Unknown = ty {

View File

@ -8,6 +8,8 @@
use std::iter;
use std::sync::Arc;
use hir_def::path::{GenericArg, PathSegment};
use super::{
FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor,
TypeWalk,
@ -18,7 +20,6 @@ use crate::{
generics::HasGenericParams,
generics::{GenericDef, WherePredicate},
nameres::Namespace,
path::{GenericArg, PathSegment},
resolve::{Resolver, TypeNs},
ty::Adt,
type_ref::{TypeBound, TypeRef},