diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-08 09:29:19 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-08 09:29:19 +0100 |
commit | 5b19825e376b67aabbe8d5b163bf69b1acd92f04 (patch) | |
tree | bdf8054c58b9dba7116473ae4b0a772851a27c0c /crates/ra_hir/src/generics.rs | |
parent | a4316d6c63486d718f4d2e56d151180ef40ff0a1 (diff) | |
parent | 09b72489dd085dadce94b454408d18a36abb1681 (diff) |
Merge #1507
1507: Constify KnownName's r=matklad a=mominul
Closes #1503
Co-authored-by: Muhammad Mominul Huque <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/generics.rs')
-rw-r--r-- | crates/ra_hir/src/generics.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/ra_hir/src/generics.rs b/crates/ra_hir/src/generics.rs index 521e47090..07a59193f 100644 --- a/crates/ra_hir/src/generics.rs +++ b/crates/ra_hir/src/generics.rs | |||
@@ -9,6 +9,7 @@ use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, Ty | |||
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | db::{AstDatabase, DefDatabase, HirDatabase}, | 11 | db::{AstDatabase, DefDatabase, HirDatabase}, |
12 | name::SELF_TYPE, | ||
12 | path::Path, | 13 | path::Path, |
13 | type_ref::TypeRef, | 14 | type_ref::TypeRef, |
14 | AdtDef, AsName, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, | 15 | AdtDef, AsName, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, |
@@ -81,11 +82,7 @@ impl GenericParams { | |||
81 | GenericDef::Enum(it) => generics.fill(&*it.source(db).ast, start), | 82 | GenericDef::Enum(it) => generics.fill(&*it.source(db).ast, start), |
82 | GenericDef::Trait(it) => { | 83 | GenericDef::Trait(it) => { |
83 | // traits get the Self type as an implicit first type parameter | 84 | // traits get the Self type as an implicit first type parameter |
84 | generics.params.push(GenericParam { | 85 | generics.params.push(GenericParam { idx: start, name: SELF_TYPE, default: None }); |
85 | idx: start, | ||
86 | name: Name::self_type(), | ||
87 | default: None, | ||
88 | }); | ||
89 | generics.fill(&*it.source(db).ast, start + 1); | 86 | generics.fill(&*it.source(db).ast, start + 1); |
90 | } | 87 | } |
91 | GenericDef::TypeAlias(it) => generics.fill(&*it.source(db).ast, start), | 88 | GenericDef::TypeAlias(it) => generics.fill(&*it.source(db).ast, start), |