aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir_def/src/nameres.rs6
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs6
2 files changed, 5 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs
index e1959cdb9..fb3ba5305 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/ra_hir_def/src/nameres.rs
@@ -195,12 +195,6 @@ pub struct Resolution {
195 pub import: Option<ImportId>, 195 pub import: Option<ImportId>,
196} 196}
197 197
198impl Resolution {
199 fn from_macro(macro_: MacroDefId) -> Self {
200 Resolution { def: PerNs::macros(macro_), import: None }
201 }
202}
203
204#[derive(Debug, Clone)] 198#[derive(Debug, Clone)]
205struct ResolvePathResult { 199struct ResolvePathResult {
206 resolved_def: PerNs, 200 resolved_def: PerNs,
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs
index 3b61d9895..9ab378d54 100644
--- a/crates/ra_hir_def/src/nameres/collector.rs
+++ b/crates/ra_hir_def/src/nameres/collector.rs
@@ -182,7 +182,11 @@ where
182 // In Rust, `#[macro_export]` macros are unconditionally visible at the 182 // In Rust, `#[macro_export]` macros are unconditionally visible at the
183 // crate root, even if the parent modules is **not** visible. 183 // crate root, even if the parent modules is **not** visible.
184 if export { 184 if export {
185 self.update(self.def_map.root, None, &[(name, Resolution::from_macro(macro_))]); 185 self.update(
186 self.def_map.root,
187 None,
188 &[(name, Resolution { def: PerNs::macros(macro_), import: None })],
189 );
186 } 190 }
187 } 191 }
188 192