mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Rename GenericParam -> TypeParam
We don't have LifetimeParam yet, but they are planned!
This commit is contained in:
parent
f4f8b81474
commit
88c5b1282a
18 changed files with 77 additions and 79 deletions
|
@ -15,9 +15,9 @@ use hir_def::{
|
|||
per_ns::PerNs,
|
||||
resolver::HasResolver,
|
||||
type_ref::{Mutability, TypeRef},
|
||||
AdtId, AstItemDef, ConstId, ContainerId, DefWithBodyId, EnumId, FunctionId, GenericParamId,
|
||||
HasModule, ImplId, LocalEnumVariantId, LocalImportId, LocalModuleId, LocalStructFieldId,
|
||||
Lookup, ModuleId, StaticId, StructId, TraitId, TypeAliasId, UnionId,
|
||||
AdtId, AstItemDef, ConstId, ContainerId, DefWithBodyId, EnumId, FunctionId, HasModule, ImplId,
|
||||
LocalEnumVariantId, LocalImportId, LocalModuleId, LocalStructFieldId, Lookup, ModuleId,
|
||||
StaticId, StructId, TraitId, TypeAliasId, TypeParamId, UnionId,
|
||||
};
|
||||
use hir_expand::{
|
||||
diagnostics::DiagnosticSink,
|
||||
|
@ -856,14 +856,14 @@ impl Local {
|
|||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct GenericParam {
|
||||
pub(crate) id: GenericParamId,
|
||||
pub struct TypeParam {
|
||||
pub(crate) id: TypeParamId,
|
||||
}
|
||||
|
||||
impl GenericParam {
|
||||
impl TypeParam {
|
||||
pub fn name(self, db: &impl HirDatabase) -> Name {
|
||||
let params = db.generic_params(self.id.parent);
|
||||
params.params[self.id.local_id].name.clone()
|
||||
params.types[self.id.local_id].name.clone()
|
||||
}
|
||||
|
||||
pub fn module(self, db: &impl HirDatabase) -> Module {
|
||||
|
@ -1111,7 +1111,7 @@ impl HirDisplay for Type {
|
|||
pub enum ScopeDef {
|
||||
ModuleDef(ModuleDef),
|
||||
MacroDef(MacroDef),
|
||||
GenericParam(GenericParam),
|
||||
GenericParam(TypeParam),
|
||||
ImplSelfType(ImplBlock),
|
||||
AdtSelfType(Adt),
|
||||
Local(Local),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue