aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-15 16:20:31 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-15 16:20:31 +0000
commit323938dae58576f5fa86ddebf88fdcb5b09662ed (patch)
treedfeae99da99f6f9b2d91d31f84c0a3b527cfffbe /crates/ra_hir/src/ty
parent72a4951023f11adfdf0eac353c99d8a01a9471fc (diff)
parentfafcd103d26821a8408572514201a40765bb2d2b (diff)
Merge #555
555: remove Cancelable from ids r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs
index c7fbcfd06..94c5124a9 100644
--- a/crates/ra_hir/src/ty/method_resolution.rs
+++ b/crates/ra_hir/src/ty/method_resolution.rs
@@ -49,14 +49,14 @@ impl CrateImplBlocks {
49 .into_iter() 49 .into_iter()
50 .flat_map(|i| i.iter()) 50 .flat_map(|i| i.iter())
51 .map(move |(module_id, impl_id)| { 51 .map(move |(module_id, impl_id)| {
52 let module_impl_blocks = db.impls_in_module(self.source_root_id, *module_id)?; 52 let module_impl_blocks = db.impls_in_module(self.source_root_id, *module_id);
53 Ok(ImplBlock::from_id(module_impl_blocks, *impl_id)) 53 Ok(ImplBlock::from_id(module_impl_blocks, *impl_id))
54 }) 54 })
55 } 55 }
56 56
57 fn collect_recursive(&mut self, db: &impl HirDatabase, module: Module) -> Cancelable<()> { 57 fn collect_recursive(&mut self, db: &impl HirDatabase, module: Module) -> Cancelable<()> {
58 let module_id = module.def_id.loc(db).module_id; 58 let module_id = module.def_id.loc(db).module_id;
59 let module_impl_blocks = db.impls_in_module(self.source_root_id, module_id)?; 59 let module_impl_blocks = db.impls_in_module(self.source_root_id, module_id);
60 60
61 for (impl_id, impl_data) in module_impl_blocks.impls.iter() { 61 for (impl_id, impl_data) in module_impl_blocks.impls.iter() {
62 let impl_block = ImplBlock::from_id(Arc::clone(&module_impl_blocks), impl_id); 62 let impl_block = ImplBlock::from_id(Arc::clone(&module_impl_blocks), impl_id);
@@ -100,10 +100,10 @@ impl CrateImplBlocks {
100 } 100 }
101} 101}
102 102
103fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Cancelable<Option<Crate>> { 103fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Option<Crate> {
104 match ty { 104 match ty {
105 Ty::Adt { def_id, .. } => def_id.krate(db), 105 Ty::Adt { def_id, .. } => def_id.krate(db),
106 _ => Ok(None), 106 _ => None,
107 } 107 }
108} 108}
109 109
@@ -139,7 +139,7 @@ impl Ty {
139 // rustc does an autoderef and then autoref again). 139 // rustc does an autoderef and then autoref again).
140 140
141 for derefed_ty in self.autoderef(db) { 141 for derefed_ty in self.autoderef(db) {
142 let krate = match def_crate(db, &derefed_ty)? { 142 let krate = match def_crate(db, &derefed_ty) {
143 Some(krate) => krate, 143 Some(krate) => krate,
144 None => continue, 144 None => continue,
145 }; 145 };