]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir/src/semantics.rs
hir_ty: Expand macros at type position
[rust.git] / crates / hir / src / semantics.rs
index 7955bf0b52feb89a82a3a71c0801cf5b2797dae3..29c0821cfed63701428e943f0215f706326c4c8a 100644 (file)
@@ -6,6 +6,7 @@
 
 use base_db::{FileId, FileRange};
 use hir_def::{
+    body,
     resolver::{self, HasResolver, Resolver, TypeNs},
     AsMacroCall, FunctionId, TraitId, VariantId,
 };
@@ -854,7 +855,8 @@ pub fn process_all_names(&self, f: &mut dyn FnMut(Name, ScopeDef)) {
     /// necessary a heuristic, as it doesn't take hygiene into account.
     pub fn speculative_resolve(&self, path: &ast::Path) -> Option<PathResolution> {
         let hygiene = Hygiene::new(self.db.upcast(), self.file_id);
-        let path = Path::from_src(path.clone(), &hygiene)?;
+        let ctx = body::LowerCtx::with_hygiene(&hygiene);
+        let path = Path::from_src(path.clone(), &ctx)?;
         resolve_hir_path(self.db, &self.resolver, &path)
     }
 }