diff options
author | Jonas Schievink <[email protected]> | 2020-06-26 17:02:41 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-06-26 17:02:41 +0100 |
commit | 7f6694b12eaae4aa0359319e57abfced97344227 (patch) | |
tree | e2d09899171d24e83ec0fe0a1f32814fd4dc5386 /crates/ra_hir_def | |
parent | 5d7172f17e5b39737dc8d692112cf969926b7f05 (diff) |
find_inner_item: more detailed panic message
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 2e433528d..961064d29 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -574,7 +574,13 @@ impl ExprCollector<'_> { | |||
574 | .filter_map(|mod_item| mod_item.downcast::<N>()) | 574 | .filter_map(|mod_item| mod_item.downcast::<N>()) |
575 | .find(|tree_id| tree[*tree_id].ast_id().upcast() == id.value.upcast()) | 575 | .find(|tree_id| tree[*tree_id].ast_id().upcast() == id.value.upcast()) |
576 | .unwrap_or_else(|| { | 576 | .unwrap_or_else(|| { |
577 | panic!("couldn't find inner {} item for {:?}", type_name::<N>(), id) | 577 | panic!( |
578 | "couldn't find inner {} item for {:?} (AST: `{}` - {:?})", | ||
579 | type_name::<N>(), | ||
580 | id, | ||
581 | ast.syntax(), | ||
582 | ast.syntax(), | ||
583 | ) | ||
578 | }); | 584 | }); |
579 | 585 | ||
580 | ItemTreeId::new(id.file_id, item_tree_id) | 586 | ItemTreeId::new(id.file_id, item_tree_id) |