diff options
-rw-r--r-- | crates/ra_assists/src/ast_transform.rs | 10 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 3 |
2 files changed, 9 insertions, 4 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)?; |
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index abae498d8..8bb735fc6 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs | |||
@@ -44,7 +44,8 @@ mod test_db; | |||
44 | /// containing the call plus the offset of the macro call in the file. Note that | 44 | /// containing the call plus the offset of the macro call in the file. Note that |
45 | /// this is a recursive definition! However, the size_of of `HirFileId` is | 45 | /// this is a recursive definition! However, the size_of of `HirFileId` is |
46 | /// finite (because everything bottoms out at the real `FileId`) and small | 46 | /// finite (because everything bottoms out at the real `FileId`) and small |
47 | /// (`MacroCallId` uses the location internal). | 47 | /// (`MacroCallId` uses the location interning. You can check details here: |
48 | /// https://en.wikipedia.org/wiki/String_interning). | ||
48 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 49 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
49 | pub struct HirFileId(HirFileIdRepr); | 50 | pub struct HirFileId(HirFileIdRepr); |
50 | 51 | ||