diff options
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/method_resolution.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index ad80aa8b6..1330d03a8 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -81,23 +81,23 @@ impl CrateImplBlocks { | |||
81 | 81 | ||
82 | Ok(()) | 82 | Ok(()) |
83 | } | 83 | } |
84 | } | ||
85 | 84 | ||
86 | pub(crate) fn impls_in_crate( | 85 | pub(crate) fn impls_in_crate_query( |
87 | db: &impl HirDatabase, | 86 | db: &impl HirDatabase, |
88 | krate: Crate, | 87 | krate: Crate, |
89 | ) -> Cancelable<Arc<CrateImplBlocks>> { | 88 | ) -> Cancelable<Arc<CrateImplBlocks>> { |
90 | let crate_graph = db.crate_graph(); | 89 | let crate_graph = db.crate_graph(); |
91 | let file_id = crate_graph.crate_root(krate.crate_id); | 90 | let file_id = crate_graph.crate_root(krate.crate_id); |
92 | let source_root_id = db.file_source_root(file_id); | 91 | let source_root_id = db.file_source_root(file_id); |
93 | let mut crate_impl_blocks = CrateImplBlocks { | 92 | let mut crate_impl_blocks = CrateImplBlocks { |
94 | source_root_id, | 93 | source_root_id, |
95 | impls: FxHashMap::default(), | 94 | impls: FxHashMap::default(), |
96 | }; | 95 | }; |
97 | if let Some(module) = krate.root_module(db)? { | 96 | if let Some(module) = krate.root_module(db)? { |
98 | crate_impl_blocks.collect_recursive(db, module)?; | 97 | crate_impl_blocks.collect_recursive(db, module)?; |
98 | } | ||
99 | Ok(Arc::new(crate_impl_blocks)) | ||
99 | } | 100 | } |
100 | Ok(Arc::new(crate_impl_blocks)) | ||
101 | } | 101 | } |
102 | 102 | ||
103 | fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Cancelable<Option<Crate>> { | 103 | fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Cancelable<Option<Crate>> { |