diff --git a/turbopack/crates/turbo-tasks-fs/src/watcher.rs b/turbopack/crates/turbo-tasks-fs/src/watcher.rs
index bc429eb6cb16..5f2a32361de6 100644
--- a/turbopack/crates/turbo-tasks-fs/src/watcher.rs
+++ b/turbopack/crates/turbo-tasks-fs/src/watcher.rs
@@ -4,13 +4,13 @@ use std::{
mem::take,
path::{Path, PathBuf},
sync::{
- Arc, LazyLock, Mutex, MutexGuard,
+ Arc, LazyLock, Mutex,
mpsc::{Receiver, TryRecvError, channel},
},
time::Duration,
};
-use anyhow::{Context, Result, anyhow};
+use anyhow::{Context, Result};
use dashmap::DashSet;
use notify::{
Config, EventKind, PollWatcher, RecommendedWatcher, RecursiveMode, Watcher,
@@ -78,6 +78,8 @@ impl DiskWatcherInternal {
#[derive(Serialize, Deserialize)]
pub(crate) struct DiskWatcher {
+ /// This value is [`None`] when the watcher has been stopped (see
+ /// [`DiskWatcher::stop_watching`]).
#[serde(skip)]
internal: Mutex