From 7d67c71c34610b70babdcde786ec7217e6a2582b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 5 Sep 2021 19:19:34 +0200 Subject: [PATCH] Add panic info for `impl_trait`/`trait_data` --- crates/hir_def/src/data.rs | 8 ++++++++ crates/hir_ty/src/lower.rs | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs index c63e9311ab..3a3709f8f8 100644 --- a/crates/hir_def/src/data.rs +++ b/crates/hir_def/src/data.rs @@ -154,6 +154,10 @@ impl TraitData { let tr_loc = tr.lookup(db); let item_tree = tr_loc.id.item_tree(db); let tr_def = &item_tree[tr_loc.id.value]; + let _cx = stdx::panic_context::enter(format!( + "trait_data_query({:?} -> {:?} -> {:?})", + tr, tr_loc, tr_def + )); let name = tr_def.name.clone(); let is_auto = tr_def.is_auto; let is_unsafe = tr_def.is_unsafe; @@ -341,6 +345,10 @@ fn collect_items( let ast_id_map = db.ast_id_map(tree_id.file_id()); let root = db.parse_or_expand(tree_id.file_id()).unwrap(); let call = ast_id_map.get(call.ast_id).to_node(&root); + let _cx = stdx::panic_context::enter(format!( + "collect_items MacroCall: {}\nexpander={:#?}", + call, expander + )); let res = expander.enter_expand(db, call); if let Ok(res) = res { diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 0e1afe866e..176ae3ad84 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs @@ -1450,6 +1450,10 @@ pub(crate) fn impl_self_ty_recover( pub(crate) fn impl_trait_query(db: &dyn HirDatabase, impl_id: ImplId) -> Option> { let impl_data = db.impl_data(impl_id); let resolver = impl_id.resolver(db.upcast()); + let _cx = stdx::panic_context::enter(format!( + "impl_trait_query({:?} -> {:?}) resolver={:#?}", + impl_id, impl_data, resolver + )); let ctx = TyLoweringContext::new(db, &resolver).with_type_param_mode(TypeParamLoweringMode::Variable); let (self_ty, binders) = db.impl_self_ty(impl_id).into_value_and_skipped_binders();