aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/path.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-05-06 22:23:50 +0100
committerJonas Schievink <[email protected]>2021-05-06 22:23:50 +0100
commit20ae41c1a12963e938cb3bd4c7c84007412d6fa6 (patch)
tree361153338ec7c32866a5477b3e7681d05a4b0b7c /crates/hir_def/src/path.rs
parentc4f9cb9b53314b584f6451908ce40bbd65453116 (diff)
Reuse database in LowerCtx
Diffstat (limited to 'crates/hir_def/src/path.rs')
-rw-r--r--crates/hir_def/src/path.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_def/src/path.rs b/crates/hir_def/src/path.rs
index 64bff318e..a43441b1c 100644
--- a/crates/hir_def/src/path.rs
+++ b/crates/hir_def/src/path.rs
@@ -49,7 +49,7 @@ pub enum ImportAlias {
49impl ModPath { 49impl ModPath {
50 pub fn from_src(db: &dyn DefDatabase, path: ast::Path, hygiene: &Hygiene) -> Option<ModPath> { 50 pub fn from_src(db: &dyn DefDatabase, path: ast::Path, hygiene: &Hygiene) -> Option<ModPath> {
51 let ctx = LowerCtx::with_hygiene(db, hygiene); 51 let ctx = LowerCtx::with_hygiene(db, hygiene);
52 lower::lower_path(db, path, &ctx).map(|it| (*it.mod_path).clone()) 52 lower::lower_path(path, &ctx).map(|it| (*it.mod_path).clone())
53 } 53 }
54 54
55 pub fn from_segments(kind: PathKind, segments: impl IntoIterator<Item = Name>) -> ModPath { 55 pub fn from_segments(kind: PathKind, segments: impl IntoIterator<Item = Name>) -> ModPath {
@@ -169,8 +169,8 @@ pub enum GenericArg {
169impl Path { 169impl Path {
170 /// Converts an `ast::Path` to `Path`. Works with use trees. 170 /// Converts an `ast::Path` to `Path`. Works with use trees.
171 /// It correctly handles `$crate` based path from macro call. 171 /// It correctly handles `$crate` based path from macro call.
172 pub fn from_src(db: &dyn DefDatabase, path: ast::Path, ctx: &LowerCtx) -> Option<Path> { 172 pub fn from_src(path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
173 lower::lower_path(db, path, ctx) 173 lower::lower_path(path, ctx)
174 } 174 }
175 175
176 /// Converts a known mod path to `Path`. 176 /// Converts a known mod path to `Path`.