From ff609cc49715571324b72d2bda60d56878466640 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 11 Nov 2019 17:22:06 +0300 Subject: Don't reexport generics from HIR --- crates/ra_hir/src/lib.rs | 4 ++-- crates/ra_hir/src/ty.rs | 12 ++++++------ crates/ra_hir/src/ty/autoderef.rs | 2 +- crates/ra_hir/src/ty/infer/path.rs | 3 ++- crates/ra_hir/src/ty/traits/chalk.rs | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 806f1daed..125c4b289 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -39,7 +39,7 @@ mod ty; mod impl_block; mod expr; mod lang_item; -mod generics; +pub mod generics; mod resolve; pub mod diagnostics; mod util; @@ -70,7 +70,7 @@ pub use crate::{ }, expr::ExprScopes, from_source::FromSource, - generics::{GenericDef, GenericParam, GenericParams, HasGenericParams}, + generics::GenericDef, ids::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile}, impl_block::ImplBlock, resolve::ScopeDef, diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index cd2ac0e8b..6f24cfad6 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -17,8 +17,11 @@ use std::sync::Arc; use std::{fmt, iter, mem}; use crate::{ - db::HirDatabase, expr::ExprId, util::make_mut_slice, Adt, Crate, DefWithBody, GenericParams, - HasGenericParams, Mutability, Name, Trait, TypeAlias, + db::HirDatabase, + expr::ExprId, + generics::{GenericParams, HasGenericParams}, + util::make_mut_slice, + Adt, Crate, DefWithBody, Mutability, Name, Trait, TypeAlias, }; use display::{HirDisplay, HirFormatter}; @@ -342,10 +345,7 @@ impl Substs { ) } - pub fn build_for_def( - db: &impl HirDatabase, - def: impl crate::HasGenericParams, - ) -> SubstsBuilder { + pub fn build_for_def(db: &impl HirDatabase, def: impl HasGenericParams) -> SubstsBuilder { let params = def.generic_params(db); let param_count = params.count_params_including_parent(); Substs::builder(param_count) diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index 3645ee831..872a4517d 100644 --- a/crates/ra_hir/src/ty/autoderef.rs +++ b/crates/ra_hir/src/ty/autoderef.rs @@ -9,7 +9,7 @@ use hir_expand::name; use log::{info, warn}; use super::{traits::Solution, Canonical, Substs, Ty, TypeWalk}; -use crate::{db::HirDatabase, HasGenericParams, Resolver}; +use crate::{db::HirDatabase, generics::HasGenericParams, Resolver}; const AUTODEREF_RECURSION_LIMIT: usize = 10; diff --git a/crates/ra_hir/src/ty/infer/path.rs b/crates/ra_hir/src/ty/infer/path.rs index 865ced5a1..31ca675aa 100644 --- a/crates/ra_hir/src/ty/infer/path.rs +++ b/crates/ra_hir/src/ty/infer/path.rs @@ -5,9 +5,10 @@ use hir_def::path::PathSegment; use super::{ExprOrPatId, InferenceContext, TraitRef}; use crate::{ db::HirDatabase, + generics::HasGenericParams, resolve::{ResolveValueResult, Resolver, TypeNs, ValueNs}, ty::{method_resolution, Namespace, Substs, Ty, TypableDef, TypeWalk}, - AssocItem, Container, HasGenericParams, Name, Path, + AssocItem, Container, Name, Path, }; impl<'a, D: HirDatabase> InferenceContext<'a, D> { diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index c694952f3..14c54b9fb 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs @@ -16,13 +16,13 @@ use ra_db::salsa::{InternId, InternKey}; use super::{Canonical, ChalkContext, Impl, Obligation}; use crate::{ db::HirDatabase, - generics::GenericDef, + generics::{GenericDef, HasGenericParams}, ty::display::HirDisplay, ty::{ ApplicationTy, GenericPredicate, Namespace, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk, }, - AssocItem, Crate, HasGenericParams, ImplBlock, Trait, TypeAlias, + AssocItem, Crate, ImplBlock, Trait, TypeAlias, }; /// This represents a trait whose name we could not resolve. -- cgit v1.2.3