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/nameres/collector.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/nameres/collector.rs')
-rw-r--r-- | crates/ra_hir/src/nameres/collector.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index 9f197bb58..552a1b6d9 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs | |||
@@ -8,12 +8,13 @@ use test_utils::tested_by; | |||
8 | use crate::{ | 8 | use crate::{ |
9 | either::Either, | 9 | either::Either, |
10 | ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind}, | 10 | ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind}, |
11 | name::MACRO_RULES, | ||
11 | nameres::{ | 12 | nameres::{ |
12 | diagnostics::DefDiagnostic, raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData, | 13 | diagnostics::DefDiagnostic, raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData, |
13 | ModuleDef, PerNs, ReachedFixedPoint, Resolution, ResolveMode, | 14 | ModuleDef, PerNs, ReachedFixedPoint, Resolution, ResolveMode, |
14 | }, | 15 | }, |
15 | AstId, Const, DefDatabase, Enum, Function, HirFileId, KnownName, MacroDef, Module, Name, Path, | 16 | AstId, Const, DefDatabase, Enum, Function, HirFileId, MacroDef, Module, Name, Path, Static, |
16 | Static, Struct, Trait, TypeAlias, Union, | 17 | Struct, Trait, TypeAlias, Union, |
17 | }; | 18 | }; |
18 | 19 | ||
19 | pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { | 20 | pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { |
@@ -624,7 +625,7 @@ where | |||
624 | } | 625 | } |
625 | 626 | ||
626 | fn is_macro_rules(path: &Path) -> bool { | 627 | fn is_macro_rules(path: &Path) -> bool { |
627 | path.as_ident().and_then(Name::as_known_name) == Some(KnownName::MacroRules) | 628 | path.as_ident() == Some(&MACRO_RULES) |
628 | } | 629 | } |
629 | 630 | ||
630 | fn resolve_submodule( | 631 | fn resolve_submodule( |