aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/ast_transform.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/ast_transform.rs')
-rw-r--r--crates/ra_assists/src/ast_transform.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs
index 6c92124ed..07c978378 100644
--- a/crates/ra_assists/src/ast_transform.rs
+++ b/crates/ra_assists/src/ast_transform.rs
@@ -110,7 +110,9 @@ impl<'a> SubstituteTypeParams<'a> {
110 ast::Type::PathType(path_type) => path_type.path()?, 110 ast::Type::PathType(path_type) => path_type.path()?,
111 _ => return None, 111 _ => return None,
112 }; 112 };
113 let path = hir::Path::from_src(path, &hir::Hygiene::new_unhygienic())?; 113 // FIXME: use `hir::Path::from_src` instead.
114 #[allow(deprecated)]
115 let path = hir::Path::from_ast(path)?;
114 let resolution = self.source_scope.resolve_hir_path(&path)?; 116 let resolution = self.source_scope.resolve_hir_path(&path)?;
115 match resolution { 117 match resolution {
116 hir::PathResolution::TypeParam(tp) => Some(self.substs.get(&tp)?.syntax().clone()), 118 hir::PathResolution::TypeParam(tp) => Some(self.substs.get(&tp)?.syntax().clone()),
@@ -150,8 +152,10 @@ impl<'a> QualifyPaths<'a> {
150 // don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway 152 // don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
151 return None; 153 return None;
152 } 154 }
153 let hir_path = hir::Path::from_src(p.clone(), &hir::Hygiene::new_unhygienic())?; 155 // FIXME: use `hir::Path::from_src` instead.
154 let resolution = self.source_scope.resolve_hir_path(&hir_path)?; 156 #[allow(deprecated)]
157 let hir_path = hir::Path::from_ast(p.clone());
158 let resolution = self.source_scope.resolve_hir_path(&hir_path?)?;
155 match resolution { 159 match resolution {
156 PathResolution::Def(def) => { 160 PathResolution::Def(def) => {
157 let found_path = from.find_use_path(self.source_scope.db.upcast(), def)?; 161 let found_path = from.find_use_path(self.source_scope.db.upcast(), def)?;