From 0b8e1456414524ca56574b90da71b889eebb761f Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 2 Jul 2021 15:28:38 +0200 Subject: [PATCH] Print runnable kind on assertion failure for better debuggability --- crates/ide/src/runnables.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index d1ea3491e83..1b731584e03 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs @@ -105,10 +105,12 @@ pub(crate) fn runnables(db: &RootDatabase, file_id: FileId) -> Vec { let mut res = Vec::new(); let mut add_opt = |runnable: Option| { - if let Some(runnable) = runnable.filter(|r| { + if let Some(runnable) = runnable.filter(|runnable| { always!( - r.nav.file_id == file_id, - "tried adding a runnable pointing to a different file" + runnable.nav.file_id == file_id, + "tried adding a runnable pointing to a different file: {:?} for {:?}", + runnable.kind, + file_id ) }) { res.push(runnable);