diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-15 15:19:40 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-15 15:19:40 +0000 |
commit | 91feed736f91a3790b2f5a5d0d879c06843bce95 (patch) | |
tree | 6a71bcb433b82e4c473238d439aad2ef76144157 /crates/ra_hir/src/ids.rs | |
parent | a36b2cf377a90cf13bb097e57878b8384d30c53a (diff) | |
parent | fb012e5c1e49af73b480127bcf56d8f5993b8032 (diff) |
Merge #550
550: remove Cancelable from source binders 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 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 316896dce..d7cc9b4ca 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -163,7 +163,7 @@ impl DefId { | |||
163 | let loc = self.loc(db); | 163 | let loc = self.loc(db); |
164 | let res = match loc.kind { | 164 | let res = 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) |
168 | } | 168 | } |
169 | DefKind::Function => { | 169 | DefKind::Function => { |
@@ -208,7 +208,11 @@ impl DefId { | |||
208 | /// For a module, returns that module; for any other def, returns the containing module. | 208 | /// For a module, returns that module; for any other def, returns the containing module. |
209 | pub fn module(self, db: &impl HirDatabase) -> Cancelable<Module> { | 209 | pub fn module(self, db: &impl HirDatabase) -> Cancelable<Module> { |
210 | let loc = self.loc(db); | 210 | let loc = self.loc(db); |
211 | Module::from_module_id(db, loc.source_root_id, loc.module_id) | 211 | Ok(Module::from_module_id( |
212 | db, | ||
213 | loc.source_root_id, | ||
214 | loc.module_id, | ||
215 | )) | ||
212 | } | 216 | } |
213 | 217 | ||
214 | /// Returns the containing crate. | 218 | /// Returns the containing crate. |