Revert some FIXMEs
Signed-off-by: JmPotato <ghzpotato@gmail.com>
This commit is contained in:
parent
7fbc9afca4
commit
6ef019bd46
@ -110,7 +110,9 @@ fn get_substitution_inner(
|
|||||||
ast::Type::PathType(path_type) => path_type.path()?,
|
ast::Type::PathType(path_type) => path_type.path()?,
|
||||||
_ => return None,
|
_ => 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)?;
|
let resolution = self.source_scope.resolve_hir_path(&path)?;
|
||||||
match resolution {
|
match resolution {
|
||||||
hir::PathResolution::TypeParam(tp) => Some(self.substs.get(&tp)?.syntax().clone()),
|
hir::PathResolution::TypeParam(tp) => Some(self.substs.get(&tp)?.syntax().clone()),
|
||||||
@ -150,8 +152,10 @@ fn get_substitution_inner(
|
|||||||
// don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
|
// don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let hir_path = hir::Path::from_src(p.clone(), &hir::Hygiene::new_unhygienic())?;
|
// FIXME: use `hir::Path::from_src` instead.
|
||||||
let resolution = self.source_scope.resolve_hir_path(&hir_path)?;
|
#[allow(deprecated)]
|
||||||
|
let hir_path = hir::Path::from_ast(p.clone());
|
||||||
|
let resolution = self.source_scope.resolve_hir_path(&hir_path?)?;
|
||||||
match resolution {
|
match resolution {
|
||||||
PathResolution::Def(def) => {
|
PathResolution::Def(def) => {
|
||||||
let found_path = from.find_use_path(self.source_scope.db.upcast(), def)?;
|
let found_path = from.find_use_path(self.source_scope.db.upcast(), def)?;
|
||||||
|
@ -44,7 +44,8 @@
|
|||||||
/// containing the call plus the offset of the macro call in the file. Note that
|
/// 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
|
/// this is a recursive definition! However, the size_of of `HirFileId` is
|
||||||
/// finite (because everything bottoms out at the real `FileId`) and small
|
/// 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)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub struct HirFileId(HirFileIdRepr);
|
pub struct HirFileId(HirFileIdRepr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user