]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_def/src/path.rs
hir_ty: Expand macros at type position
[rust.git] / crates / hir_def / src / path.rs
index b528ff8bad74a62bafeab1b186203b67bbdb3db7..509f77850a304376d94b6f044ba843355548560d 100644 (file)
@@ -48,7 +48,8 @@ pub enum ImportAlias {
 
 impl ModPath {
     pub fn from_src(path: ast::Path, hygiene: &Hygiene) -> Option<ModPath> {
-        lower::lower_path(path, hygiene).map(|it| (*it.mod_path).clone())
+        let ctx = LowerCtx::with_hygiene(hygiene);
+        lower::lower_path(path, &ctx).map(|it| (*it.mod_path).clone())
     }
 
     pub fn from_segments(kind: PathKind, segments: impl IntoIterator<Item = Name>) -> ModPath {
@@ -167,8 +168,8 @@ pub enum GenericArg {
 impl Path {
     /// Converts an `ast::Path` to `Path`. Works with use trees.
     /// It correctly handles `$crate` based path from macro call.
-    pub fn from_src(path: ast::Path, hygiene: &Hygiene) -> Option<Path> {
-        lower::lower_path(path, hygiene)
+    pub fn from_src(path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
+        lower::lower_path(path, ctx)
     }
 
     /// Converts a known mod path to `Path`.