9462: minor: Print runnable kind on assertion failure for better debuggability r=Veykril a=Veykril

We are somehow hitting this when looking at `crates\ide_db\src\lib.rs` and I don't see how.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-07-02 13:35:13 +00:00 committed by GitHub
commit 021f6772e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,10 +105,12 @@ pub(crate) fn runnables(db: &RootDatabase, file_id: FileId) -> Vec<Runnable> {
let mut res = Vec::new();
let mut add_opt = |runnable: Option<Runnable>| {
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);