diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-12 22:55:02 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-12 22:55:02 +0000 |
commit | 5368e2c103dc313d65216f5c42e9895b5f3a11b1 (patch) | |
tree | 59b4da5ee127a337cf516151127f900b8920001d /crates/hir_ty/src | |
parent | 437527b22612a17024751c78f69715e625bf6a96 (diff) | |
parent | 8447f101ac2170abd30d030b2a5e9a9fdb282d76 (diff) |
Merge #7989
7989: Remove `ItemTree::source` r=jonas-schievink a=jonas-schievink
`HasSource` should be used instead
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/tests.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/hir_ty/src/tests.rs b/crates/hir_ty/src/tests.rs index fc770ea60..0a4141e69 100644 --- a/crates/hir_ty/src/tests.rs +++ b/crates/hir_ty/src/tests.rs | |||
@@ -19,6 +19,7 @@ use hir_def::{ | |||
19 | item_scope::ItemScope, | 19 | item_scope::ItemScope, |
20 | keys, | 20 | keys, |
21 | nameres::DefMap, | 21 | nameres::DefMap, |
22 | src::HasSource, | ||
22 | AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId, | 23 | AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId, |
23 | }; | 24 | }; |
24 | use hir_expand::{db::AstDatabase, InFile}; | 25 | use hir_expand::{db::AstDatabase, InFile}; |
@@ -195,18 +196,15 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String { | |||
195 | defs.sort_by_key(|def| match def { | 196 | defs.sort_by_key(|def| match def { |
196 | DefWithBodyId::FunctionId(it) => { | 197 | DefWithBodyId::FunctionId(it) => { |
197 | let loc = it.lookup(&db); | 198 | let loc = it.lookup(&db); |
198 | let tree = db.item_tree(loc.id.file_id); | 199 | loc.source(&db).value.syntax().text_range().start() |
199 | tree.source(&db, loc.id).syntax().text_range().start() | ||
200 | } | 200 | } |
201 | DefWithBodyId::ConstId(it) => { | 201 | DefWithBodyId::ConstId(it) => { |
202 | let loc = it.lookup(&db); | 202 | let loc = it.lookup(&db); |
203 | let tree = db.item_tree(loc.id.file_id); | 203 | loc.source(&db).value.syntax().text_range().start() |
204 | tree.source(&db, loc.id).syntax().text_range().start() | ||
205 | } | 204 | } |
206 | DefWithBodyId::StaticId(it) => { | 205 | DefWithBodyId::StaticId(it) => { |
207 | let loc = it.lookup(&db); | 206 | let loc = it.lookup(&db); |
208 | let tree = db.item_tree(loc.id.file_id); | 207 | loc.source(&db).value.syntax().text_range().start() |
209 | tree.source(&db, loc.id).syntax().text_range().start() | ||
210 | } | 208 | } |
211 | }); | 209 | }); |
212 | for def in defs { | 210 | for def in defs { |