diff --git a/crates/red_knot_workspace/src/watch/watcher.rs b/crates/red_knot_workspace/src/watch/watcher.rs index ef6ee2fdd2cd6..b51c10126ba54 100644 --- a/crates/red_knot_workspace/src/watch/watcher.rs +++ b/crates/red_knot_workspace/src/watch/watcher.rs @@ -209,8 +209,16 @@ impl Debouncer { return; } + let Some(path) = event.paths.into_iter().next() else { + tracing::debug!( + "Ignoring change event with kind '{:?}' without a path.", + event.kind + ); + return; + }; + let kind = event.kind; - let path = match SystemPathBuf::from_path_buf(event.paths.into_iter().next().unwrap()) { + let path = match SystemPathBuf::from_path_buf(path) { Ok(path) => path, Err(path) => { tracing::debug!(