mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Code review fixes
This commit is contained in:
parent
6dae5cbb11
commit
c669b2f489
3 changed files with 19 additions and 22 deletions
|
@ -59,7 +59,7 @@ pub use hir_def::{
|
|||
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.
|
||||
};
|
||||
pub use hir_expand::{
|
||||
name::{known, Name},
|
||||
name::{name, Name},
|
||||
HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin,
|
||||
};
|
||||
pub use hir_ty::{display::HirDisplay, CallableDef};
|
||||
|
|
|
@ -143,9 +143,6 @@ pub mod known {
|
|||
std,
|
||||
core,
|
||||
alloc,
|
||||
hash,
|
||||
fmt,
|
||||
io,
|
||||
iter,
|
||||
ops,
|
||||
future,
|
||||
|
@ -170,9 +167,6 @@ pub mod known {
|
|||
Neg,
|
||||
Not,
|
||||
Index,
|
||||
Display,
|
||||
Iterator,
|
||||
Hasher,
|
||||
// Builtin macros
|
||||
file,
|
||||
column,
|
||||
|
@ -193,6 +187,13 @@ pub mod known {
|
|||
PartialOrd,
|
||||
Eq,
|
||||
PartialEq,
|
||||
// FIXME delete those after `ImportResolver` is removed.
|
||||
hash,
|
||||
fmt,
|
||||
io,
|
||||
Display,
|
||||
Iterator,
|
||||
Hasher,
|
||||
);
|
||||
|
||||
// self/Self cannot be used as an identifier
|
||||
|
|
|
@ -72,62 +72,58 @@ pub(crate) struct ImportResolver {
|
|||
|
||||
impl ImportResolver {
|
||||
pub(crate) fn new() -> Self {
|
||||
use hir::name;
|
||||
|
||||
let dummy_names = vec![
|
||||
(
|
||||
SmolStr::new("fmt"),
|
||||
ModPath { kind: PathKind::Plain, segments: vec![hir::known::std, hir::known::fmt] },
|
||||
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![fmt]] },
|
||||
),
|
||||
(
|
||||
SmolStr::new("io"),
|
||||
ModPath { kind: PathKind::Plain, segments: vec![hir::known::std, hir::known::io] },
|
||||
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![io]] },
|
||||
),
|
||||
(
|
||||
SmolStr::new("iter"),
|
||||
ModPath {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![hir::known::std, hir::known::iter],
|
||||
},
|
||||
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![iter]] },
|
||||
),
|
||||
(
|
||||
SmolStr::new("hash"),
|
||||
ModPath {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![hir::known::std, hir::known::hash],
|
||||
},
|
||||
ModPath { kind: PathKind::Plain, segments: vec![name![std], name![hash]] },
|
||||
),
|
||||
(
|
||||
SmolStr::new("Debug"),
|
||||
ModPath {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![hir::known::std, hir::known::fmt, hir::known::Debug],
|
||||
segments: vec![name![std], name![fmt], name![Debug]],
|
||||
},
|
||||
),
|
||||
(
|
||||
SmolStr::new("Display"),
|
||||
ModPath {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![hir::known::std, hir::known::fmt, hir::known::Display],
|
||||
segments: vec![name![std], name![fmt], name![Display]],
|
||||
},
|
||||
),
|
||||
(
|
||||
SmolStr::new("Hash"),
|
||||
ModPath {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![hir::known::std, hir::known::hash, hir::known::Hash],
|
||||
segments: vec![name![std], name![hash], name![Hash]],
|
||||
},
|
||||
),
|
||||
(
|
||||
SmolStr::new("Hasher"),
|
||||
ModPath {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![hir::known::std, hir::known::hash, hir::known::Hasher],
|
||||
segments: vec![name![std], name![hash], name![Hasher]],
|
||||
},
|
||||
),
|
||||
(
|
||||
SmolStr::new("Iterator"),
|
||||
ModPath {
|
||||
kind: PathKind::Plain,
|
||||
segments: vec![hir::known::std, hir::known::iter, hir::known::Iterator],
|
||||
segments: vec![name![std], name![iter], name![Iterator]],
|
||||
},
|
||||
),
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue