aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs5
-rw-r--r--crates/ra_hir/src/generics.rs6
-rw-r--r--crates/ra_hir/src/name.rs3
-rw-r--r--crates/ra_hir/src/nameres.rs4
-rw-r--r--crates/ra_hir/src/nameres/collector.rs4
-rw-r--r--crates/ra_hir/src/ty/infer.rs6
6 files changed, 14 insertions, 14 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 8922163ad..805357662 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -19,7 +19,10 @@ use crate::{
19 TypeAliasId, 19 TypeAliasId,
20 }, 20 },
21 impl_block::ImplBlock, 21 impl_block::ImplBlock,
22 name::{BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, STR, U128, U16, U32, U64, U8, USIZE, SELF_TYPE}, 22 name::{
23 BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, SELF_TYPE, STR, U128, U16, U32, U64,
24 U8, USIZE,
25 },
23 nameres::{CrateModuleId, ImportId, ModuleScope, Namespace}, 26 nameres::{CrateModuleId, ImportId, ModuleScope, Namespace},
24 resolve::Resolver, 27 resolve::Resolver,
25 traits::{TraitData, TraitItem}, 28 traits::{TraitData, TraitItem},
diff --git a/crates/ra_hir/src/generics.rs b/crates/ra_hir/src/generics.rs
index 3ad2c551a..07a59193f 100644
--- a/crates/ra_hir/src/generics.rs
+++ b/crates/ra_hir/src/generics.rs
@@ -82,11 +82,7 @@ impl GenericParams {
82 GenericDef::Enum(it) => generics.fill(&*it.source(db).ast, start), 82 GenericDef::Enum(it) => generics.fill(&*it.source(db).ast, start),
83 GenericDef::Trait(it) => { 83 GenericDef::Trait(it) => {
84 // traits get the Self type as an implicit first type parameter 84 // traits get the Self type as an implicit first type parameter
85 generics.params.push(GenericParam { 85 generics.params.push(GenericParam { idx: start, name: SELF_TYPE, default: None });
86 idx: start,
87 name: SELF_TYPE,
88 default: None,
89 });
90 generics.fill(&*it.source(db).ast, start + 1); 86 generics.fill(&*it.source(db).ast, start + 1);
91 } 87 }
92 GenericDef::TypeAlias(it) => generics.fill(&*it.source(db).ast, start), 88 GenericDef::TypeAlias(it) => generics.fill(&*it.source(db).ast, start),
diff --git a/crates/ra_hir/src/name.rs b/crates/ra_hir/src/name.rs
index 718795314..5f64b7759 100644
--- a/crates/ra_hir/src/name.rs
+++ b/crates/ra_hir/src/name.rs
@@ -112,7 +112,8 @@ pub(crate) const SELF_TYPE: Name = Name::new(SmolStr::new_inline_from_ascii(4, b
112pub(crate) const MACRO_RULES: Name = Name::new(SmolStr::new_inline_from_ascii(11, b"macro_rules")); 112pub(crate) const MACRO_RULES: Name = Name::new(SmolStr::new_inline_from_ascii(11, b"macro_rules"));
113pub(crate) const STD: Name = Name::new(SmolStr::new_inline_from_ascii(3, b"std")); 113pub(crate) const STD: Name = Name::new(SmolStr::new_inline_from_ascii(3, b"std"));
114pub(crate) const ITER: Name = Name::new(SmolStr::new_inline_from_ascii(4, b"iter")); 114pub(crate) const ITER: Name = Name::new(SmolStr::new_inline_from_ascii(4, b"iter"));
115pub(crate) const INTO_ITERATOR: Name = Name::new(SmolStr::new_inline_from_ascii(12, b"IntoIterator")); 115pub(crate) const INTO_ITERATOR: Name =
116 Name::new(SmolStr::new_inline_from_ascii(12, b"IntoIterator"));
116pub(crate) const ITEM: Name = Name::new(SmolStr::new_inline_from_ascii(4, b"Item")); 117pub(crate) const ITEM: Name = Name::new(SmolStr::new_inline_from_ascii(4, b"Item"));
117 118
118fn resolve_name(text: &SmolStr) -> SmolStr { 119fn resolve_name(text: &SmolStr) -> SmolStr {
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs
index 4c5623063..bbdc606cd 100644
--- a/crates/ra_hir/src/nameres.rs
+++ b/crates/ra_hir/src/nameres.rs
@@ -65,8 +65,8 @@ use test_utils::tested_by;
65 65
66use crate::{ 66use crate::{
67 diagnostics::DiagnosticSink, either::Either, ids::MacroDefId, 67 diagnostics::DiagnosticSink, either::Either, ids::MacroDefId,
68 nameres::diagnostics::DefDiagnostic, AstDatabase, AstId, BuiltinType, Crate, 68 nameres::diagnostics::DefDiagnostic, AstDatabase, AstId, BuiltinType, Crate, DefDatabase,
69 DefDatabase, HirFileId, MacroDef, Module, ModuleDef, Name, Path, PathKind, Trait, 69 HirFileId, MacroDef, Module, ModuleDef, Name, Path, PathKind, Trait,
70}; 70};
71 71
72pub(crate) use self::raw::{ImportSourceMap, RawItems}; 72pub(crate) use self::raw::{ImportSourceMap, RawItems};
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs
index 1c3b453bd..552a1b6d9 100644
--- a/crates/ra_hir/src/nameres/collector.rs
+++ b/crates/ra_hir/src/nameres/collector.rs
@@ -13,8 +13,8 @@ use crate::{
13 diagnostics::DefDiagnostic, raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData, 13 diagnostics::DefDiagnostic, raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData,
14 ModuleDef, PerNs, ReachedFixedPoint, Resolution, ResolveMode, 14 ModuleDef, PerNs, ReachedFixedPoint, Resolution, ResolveMode,
15 }, 15 },
16 AstId, Const, DefDatabase, Enum, Function, HirFileId, MacroDef, Module, Name, Path, 16 AstId, Const, DefDatabase, Enum, Function, HirFileId, MacroDef, Module, Name, Path, Static,
17 Static, Struct, Trait, TypeAlias, Union, 17 Struct, Trait, TypeAlias, Union,
18}; 18};
19 19
20pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { 20pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap {
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 41980a325..52a49070a 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -40,7 +40,7 @@ use crate::{
40 PatId, Statement, UnaryOp, 40 PatId, Statement, UnaryOp,
41 }, 41 },
42 generics::{GenericParams, HasGenericParams}, 42 generics::{GenericParams, HasGenericParams},
43 name::{SELF_TYPE, INTO_ITERATOR, ITEM, ITER, STD}, 43 name::{INTO_ITERATOR, ITEM, ITER, SELF_TYPE, STD},
44 nameres::{Namespace, PerNs}, 44 nameres::{Namespace, PerNs},
45 path::{GenericArg, GenericArgs, PathKind, PathSegment}, 45 path::{GenericArg, GenericArgs, PathKind, PathSegment},
46 resolve::{ 46 resolve::{
@@ -49,8 +49,8 @@ use crate::{
49 }, 49 },
50 ty::infer::diagnostics::InferenceDiagnostic, 50 ty::infer::diagnostics::InferenceDiagnostic,
51 type_ref::{Mutability, TypeRef}, 51 type_ref::{Mutability, TypeRef},
52 AdtDef, ConstData, DefWithBody, FnData, Function, HirDatabase, ImplItem, 52 AdtDef, ConstData, DefWithBody, FnData, Function, HirDatabase, ImplItem, ModuleDef, Name, Path,
53 ModuleDef, Name, Path, StructField, 53 StructField,
54}; 54};
55 55
56mod unify; 56mod unify;