fix: Fix general find-path inconsistencies · rust-lang/rust@5992af6 (original) (raw)

1

1

`//! Name resolution façade.

`

2

``

`-

use std::{fmt, hash::BuildHasherDefault, iter, mem};

`

``

2

`+

use std::{fmt, iter, mem};

`

3

3

``

4

4

`use base_db::CrateId;

`

5

5

`use hir_expand::{

`

6

6

` name::{name, Name},

`

7

7

`MacroDefId,

`

8

8

`};

`

9

``

`-

use indexmap::IndexMap;

`

10

9

`use intern::Interned;

`

11

10

`use rustc_hash::FxHashSet;

`

12

11

`use smallvec::{smallvec, SmallVec};

`

`@@ -27,10 +26,10 @@ use crate::{

`

27

26

` type_ref::LifetimeRef,

`

28

27

` visibility::{RawVisibility, Visibility},

`

29

28

`AdtId, ConstId, ConstParamId, CrateRootModuleId, DefWithBodyId, EnumId, EnumVariantId,

`

30

``

`-

ExternBlockId, ExternCrateId, FunctionId, GenericDefId, GenericParamId, HasModule, ImplId,

`

31

``

`-

ItemContainerId, ItemTreeLoc, LifetimeParamId, LocalModuleId, Lookup, Macro2Id, MacroId,

`

32

``

`-

MacroRulesId, ModuleDefId, ModuleId, ProcMacroId, StaticId, StructId, TraitAliasId, TraitId,

`

33

``

`-

TypeAliasId, TypeOrConstParamId, TypeOwnerId, TypeParamId, UseId, VariantId,

`

``

29

`+

ExternBlockId, ExternCrateId, FunctionId, FxIndexMap, GenericDefId, GenericParamId, HasModule,

`

``

30

`+

ImplId, ItemContainerId, ItemTreeLoc, LifetimeParamId, LocalModuleId, Lookup, Macro2Id,

`

``

31

`+

MacroId, MacroRulesId, ModuleDefId, ModuleId, ProcMacroId, StaticId, StructId, TraitAliasId,

`

``

32

`+

TraitId, TypeAliasId, TypeOrConstParamId, TypeOwnerId, TypeParamId, UseId, VariantId,

`

34

33

`};

`

35

34

``

36

35

`#[derive(Debug, Clone)]

`

`@@ -957,7 +956,6 @@ fn to_type_ns(per_ns: PerNs) -> Option<(TypeNs, Option)> {

`

957

956

`Some((res, import))

`

958

957

`}

`

959

958

``

960

``

`-

type FxIndexMap<K, V> = IndexMap<K, V, BuildHasherDefault<rustc_hash::FxHasher>>;

`

961

959

`#[derive(Default)]

`

962

960

`struct ScopeNames {

`

963

961

`map: FxIndexMap<Name, SmallVec<[ScopeDef; 1]>>,

`