Introduce LowerCtx for path lowering

This commit is contained in:
Edwin Cheng 2020-04-30 18:20:13 +08:00
parent 1635d22a35
commit bdcf6f5658
14 changed files with 172 additions and 80 deletions

View file

@ -70,6 +70,7 @@ pub use hir_def::{
type_ref::Mutability,
};
pub use hir_expand::{
name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin,
hygiene::Hygiene, name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId,
MacroFile, Origin,
};
pub use hir_ty::{display::HirDisplay, CallableDef};

View file

@ -224,7 +224,8 @@ impl SourceAnalyzer {
}
}
// This must be a normal source file rather than macro file.
let hir_path = crate::Path::from_ast(path.clone())?;
let hir_path =
crate::Path::from_src(path.clone(), &Hygiene::new(db.upcast(), self.file_id))?;
resolve_hir_path(db, &self.resolver, &hir_path)
}