diff options
author | cynecx <[email protected]> | 2021-04-12 15:24:48 +0100 |
---|---|---|
committer | cynecx <[email protected]> | 2021-04-17 15:24:56 +0100 |
commit | 28ef7c20d79803403be58eeffa18ab1fb21e261c (patch) | |
tree | 8fc1bc1b94bec220d6ab1c1bb4c67d6676b20244 /crates/hir | |
parent | cf3b4f1e208247c9d171273dabff9c6b3c98a240 (diff) |
hir_ty: deal with TypeRef::Macro in HirFormatter
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/semantics.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index 29c0821cf..62500602a 100644 --- a/crates/hir/src/semantics.rs +++ b/crates/hir/src/semantics.rs | |||
@@ -10,7 +10,7 @@ use hir_def::{ | |||
10 | resolver::{self, HasResolver, Resolver, TypeNs}, | 10 | resolver::{self, HasResolver, Resolver, TypeNs}, |
11 | AsMacroCall, FunctionId, TraitId, VariantId, | 11 | AsMacroCall, FunctionId, TraitId, VariantId, |
12 | }; | 12 | }; |
13 | use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo}; | 13 | use hir_expand::{name::AsName, ExpansionInfo}; |
14 | use hir_ty::associated_type_shorthand_candidates; | 14 | use hir_ty::associated_type_shorthand_candidates; |
15 | use itertools::Itertools; | 15 | use itertools::Itertools; |
16 | use rustc_hash::{FxHashMap, FxHashSet}; | 16 | use rustc_hash::{FxHashMap, FxHashSet}; |
@@ -854,8 +854,7 @@ impl<'a> SemanticsScope<'a> { | |||
854 | /// Resolve a path as-if it was written at the given scope. This is | 854 | /// Resolve a path as-if it was written at the given scope. This is |
855 | /// necessary a heuristic, as it doesn't take hygiene into account. | 855 | /// necessary a heuristic, as it doesn't take hygiene into account. |
856 | pub fn speculative_resolve(&self, path: &ast::Path) -> Option<PathResolution> { | 856 | pub fn speculative_resolve(&self, path: &ast::Path) -> Option<PathResolution> { |
857 | let hygiene = Hygiene::new(self.db.upcast(), self.file_id); | 857 | let ctx = body::LowerCtx::new(self.db.upcast(), self.file_id); |
858 | let ctx = body::LowerCtx::with_hygiene(&hygiene); | ||
859 | let path = Path::from_src(path.clone(), &ctx)?; | 858 | let path = Path::from_src(path.clone(), &ctx)?; |
860 | resolve_hir_path(self.db, &self.resolver, &path) | 859 | resolve_hir_path(self.db, &self.resolver, &path) |
861 | } | 860 | } |