diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-15 15:50:47 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-15 15:50:47 +0000 |
commit | 7c977a7dcd2bac3b6148f2428bcb586c6354d775 (patch) | |
tree | 6ea2db9840f91aa39b65680ace9d3079a140a12c /crates/ra_hir/src/ids.rs | |
parent | 05149d353299b54476410daeda6551e1261128ef (diff) | |
parent | f1367e0370d5de5cba13c853c7df5f0c5a0edf59 (diff) |
Merge #552
552: remove Cancelable from navigation target r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 7b572061a..3cbf8070f 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -159,9 +159,9 @@ impl DefId { | |||
159 | db.as_ref().id2loc(self) | 159 | db.as_ref().id2loc(self) |
160 | } | 160 | } |
161 | 161 | ||
162 | pub fn resolve(self, db: &impl HirDatabase) -> Cancelable<Def> { | 162 | pub fn resolve(self, db: &impl HirDatabase) -> Def { |
163 | let loc = self.loc(db); | 163 | let loc = self.loc(db); |
164 | let res = match loc.kind { | 164 | match loc.kind { |
165 | DefKind::Module => { | 165 | DefKind::Module => { |
166 | let module = Module::from_module_id(db, loc.source_root_id, loc.module_id); | 166 | let module = Module::from_module_id(db, loc.source_root_id, loc.module_id); |
167 | Def::Module(module) | 167 | Def::Module(module) |
@@ -195,8 +195,7 @@ impl DefId { | |||
195 | 195 | ||
196 | DefKind::StructCtor => Def::Item, | 196 | DefKind::StructCtor => Def::Item, |
197 | DefKind::Item => Def::Item, | 197 | DefKind::Item => Def::Item, |
198 | }; | 198 | } |
199 | Ok(res) | ||
200 | } | 199 | } |
201 | 200 | ||
202 | pub(crate) fn source(self, db: &impl HirDatabase) -> (HirFileId, TreeArc<SyntaxNode>) { | 201 | pub(crate) fn source(self, db: &impl HirDatabase) -> (HirFileId, TreeArc<SyntaxNode>) { |