From 7f6694b12eaae4aa0359319e57abfced97344227 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 26 Jun 2020 18:02:41 +0200 Subject: find_inner_item: more detailed panic message --- crates/ra_hir_def/src/body/lower.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_def/src') 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<'_> { .filter_map(|mod_item| mod_item.downcast::()) .find(|tree_id| tree[*tree_id].ast_id().upcast() == id.value.upcast()) .unwrap_or_else(|| { - panic!("couldn't find inner {} item for {:?}", type_name::(), id) + panic!( + "couldn't find inner {} item for {:?} (AST: `{}` - {:?})", + type_name::(), + id, + ast.syntax(), + ast.syntax(), + ) }); ItemTreeId::new(id.file_id, item_tree_id) -- cgit v1.2.3