mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Don't reexport generics from HIR
This commit is contained in:
parent
a599147b42
commit
ff609cc497
5 changed files with 13 additions and 12 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue