Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-ssr/src/matching.rs')
| -rw-r--r-- | crates/ide-ssr/src/matching.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide-ssr/src/matching.rs b/crates/ide-ssr/src/matching.rs index d32ba06f1e..48d2431a11 100644 --- a/crates/ide-ssr/src/matching.rs +++ b/crates/ide-ssr/src/matching.rs @@ -626,11 +626,11 @@ impl<'db, 'sema> Matcher<'db, 'sema> { match_error!("Failed to get receiver type for `{}`", expr.syntax().text()) })? .original; - let krate = self.sema.scope(expr.syntax()).map(|it| it.krate()).unwrap_or_else(|| { - hir::Crate::from( - *self.sema.db.crate_graph().crates_in_topological_order().last().unwrap(), - ) - }); + let krate = self + .sema + .scope(expr.syntax()) + .map(|it| it.krate()) + .unwrap_or_else(|| hir::Crate::from(*self.sema.db.all_crates().last().unwrap())); let res = code_type .autoderef(self.sema.db) .enumerate() |