Skip to content

Commit c669b2f

Browse files
Code review fixes
1 parent 6dae5cb commit c669b2f

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

crates/ra_hir/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub use hir_def::{
5959
ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation.
6060
};
6161
pub use hir_expand::{
62-
name::{known, Name},
62+
name::{name, Name},
6363
HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin,
6464
};
6565
pub use hir_ty::{display::HirDisplay, CallableDef};

crates/ra_hir_expand/src/name.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ pub mod known {
143143
std,
144144
core,
145145
alloc,
146-
hash,
147-
fmt,
148-
io,
149146
iter,
150147
ops,
151148
future,
@@ -170,9 +167,6 @@ pub mod known {
170167
Neg,
171168
Not,
172169
Index,
173-
Display,
174-
Iterator,
175-
Hasher,
176170
// Builtin macros
177171
file,
178172
column,
@@ -193,6 +187,13 @@ pub mod known {
193187
PartialOrd,
194188
Eq,
195189
PartialEq,
190+
// FIXME delete those after `ImportResolver` is removed.
191+
hash,
192+
fmt,
193+
io,
194+
Display,
195+
Iterator,
196+
Hasher,
196197
);
197198

198199
// self/Self cannot be used as an identifier

crates/ra_ide/src/completion/complete_scope.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,62 +72,58 @@ pub(crate) struct ImportResolver {
7272

7373
impl ImportResolver {
7474
pub(crate) fn new() -> Self {
75+
use hir::name;
76+
7577
let dummy_names = vec![
7678
(
7779
SmolStr::new("fmt"),
78-
ModPath { kind: PathKind::Plain, segments: vec![hir::known::std, hir::known::fmt] },
80+
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![fmt]] },
7981
),
8082
(
8183
SmolStr::new("io"),
82-
ModPath { kind: PathKind::Plain, segments: vec![hir::known::std, hir::known::io] },
84+
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![io]] },
8385
),
8486
(
8587
SmolStr::new("iter"),
86-
ModPath {
87-
kind: PathKind::Plain,
88-
segments: vec![hir::known::std, hir::known::iter],
89-
},
88+
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![iter]] },
9089
),
9190
(
9291
SmolStr::new("hash"),
93-
ModPath {
94-
kind: PathKind::Plain,
95-
segments: vec![hir::known::std, hir::known::hash],
96-
},
92+
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![hash]] },
9793
),
9894
(
9995
SmolStr::new("Debug"),
10096
ModPath {
10197
kind: PathKind::Plain,
102-
segments: vec![hir::known::std, hir::known::fmt, hir::known::Debug],
98+
segments: vec![name![std], name![fmt], name![Debug]],
10399
},
104100
),
105101
(
106102
SmolStr::new("Display"),
107103
ModPath {
108104
kind: PathKind::Plain,
109-
segments: vec![hir::known::std, hir::known::fmt, hir::known::Display],
105+
segments: vec![name![std], name![fmt], name![Display]],
110106
},
111107
),
112108
(
113109
SmolStr::new("Hash"),
114110
ModPath {
115111
kind: PathKind::Plain,
116-
segments: vec![hir::known::std, hir::known::hash, hir::known::Hash],
112+
segments: vec![name![std], name![hash], name![Hash]],
117113
},
118114
),
119115
(
120116
SmolStr::new("Hasher"),
121117
ModPath {
122118
kind: PathKind::Plain,
123-
segments: vec![hir::known::std, hir::known::hash, hir::known::Hasher],
119+
segments: vec![name![std], name![hash], name![Hasher]],
124120
},
125121
),
126122
(
127123
SmolStr::new("Iterator"),
128124
ModPath {
129125
kind: PathKind::Plain,
130-
segments: vec![hir::known::std, hir::known::iter, hir::known::Iterator],
126+
segments: vec![name![std], name![iter], name![Iterator]],
131127
},
132128
),
133129
];

0 commit comments

Comments
 (0)