about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJmPotato <ghzpotato@gmail.com>2020-08-11 17:19:02 +0800
committerJmPotato <ghzpotato@gmail.com>2020-08-11 17:19:02 +0800
commit6ef019bd4601b9dc36325e096d066a4ddbda1bdf (patch)
treed7ba0fa11aba8b4a8ee0f7c6fe8683e43e3fcfd7
parent7fbc9afca48240cf16c82a996ac7b14c554bade6 (diff)
downloadrust-6ef019bd4601b9dc36325e096d066a4ddbda1bdf.tar.gz
rust-6ef019bd4601b9dc36325e096d066a4ddbda1bdf.zip
Revert some FIXMEs
Signed-off-by: JmPotato <ghzpotato@gmail.com>
-rw-r--r--crates/ra_assists/src/ast_transform.rs10
-rw-r--r--crates/ra_hir_expand/src/lib.rs3
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 6c92124eda1..07c978378a6 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> {
             ast::Type::PathType(path_type) => path_type.path()?,
             _ => return None,
         };
-        let path = hir::Path::from_src(path, &hir::Hygiene::new_unhygienic())?;
+        // FIXME: use `hir::Path::from_src` instead.
+        #[allow(deprecated)]
+        let path = hir::Path::from_ast(path)?;
         let resolution = self.source_scope.resolve_hir_path(&path)?;
         match resolution {
             hir::PathResolution::TypeParam(tp) => Some(self.substs.get(&tp)?.syntax().clone()),
@@ -150,8 +152,10 @@ impl<'a> QualifyPaths<'a> {
             // don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
             return None;
         }
-        let hir_path = hir::Path::from_src(p.clone(), &hir::Hygiene::new_unhygienic())?;
-        let resolution = self.source_scope.resolve_hir_path(&hir_path)?;
+        // FIXME: use `hir::Path::from_src` instead.
+        #[allow(deprecated)]
+        let hir_path = hir::Path::from_ast(p.clone());
+        let resolution = self.source_scope.resolve_hir_path(&hir_path?)?;
         match resolution {
             PathResolution::Def(def) => {
                 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 abae498d826..8bb735fc625 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -44,7 +44,8 @@ mod test_db;
 /// containing the call plus the offset of the macro call in the file. Note that
 /// this is a recursive definition! However, the size_of of `HirFileId` is
 /// finite (because everything bottoms out at the real `FileId`) and small
-/// (`MacroCallId` uses the location internal).
+/// (`MacroCallId` uses the location interning. You can check details here:
+/// https://en.wikipedia.org/wiki/String_interning).
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
 pub struct HirFileId(HirFileIdRepr);