rust-lang/rust-analyzer · error
No title could be found; this is a bug
Error message
No title could be found; this is a bug
What it means
handle_discover_msg processes messages from the workspace discovery process and needs the progress label configured in discoverWorkspaceConfig to report progress. The expect asserts a discovery message can only arrive when discovery is configured; it panics if a message arrives with no discover_workspace_config() entry, e.g. config changed after discovery started.
Source
Thrown at crates/rust-analyzer/src/main_loop.rs:1135
analysis.is_proc_macro_crate(krate).is_ok_and(|it| it)
}),
_ => false,
}
}) {
sender.send(Task::BuildDepsHaveChanged).unwrap();
}
}
});
}
}
}
fn handle_discover_msg(&mut self, message: DiscoverProjectMessage) {
let title = self
.config
.discover_workspace_config()
.map(|cfg| cfg.progress_label.clone())
.expect("No title could be found; this is a bug");
match message {
DiscoverProjectMessage::Finished { project, buildfile } => {
self.discover_jobs_active = self.discover_jobs_active.saturating_sub(1);
if self.discover_jobs_active == 0 {
self.report_progress(&title, Progress::End, None, None, None);
}
let mut config = Config::clone(&*self.config);
config.add_discovered_project_from_command(project, buildfile);
self.update_configuration(config);
}
DiscoverProjectMessage::Progress { message } => {
if self.discover_jobs_active > 0 {
self.report_progress(&title, Progress::Report, Some(message), None, None)
}
}
DiscoverProjectMessage::Error { error, source } => {
let message = format!("Project discovery failed: {error}");View on GitHub (pinned to e8f7e90aa3)
Solutions
- Restart rust-analyzer (or reload the window) after editing discoverWorkspaceConfig so stale discovery processes are killed.
- Keep rust.analyzer.workspace.discoverConfig set as long as discovery may still be running; remove it only when no discovery is active.
- Upgrade rust-analyzer — the handler should tolerate a missing label by ending/ignoring the stale progress report.
- Check for orphaned discovery processes (e.g. the configured discovery command) still emitting messages and kill them.
Example fix
// before
let title = self.config.discover_workspace_config()
.map(|cfg| cfg.progress_label.clone())
.expect("No title could be found; this is a bug");
// after: tolerate config change mid-discovery
let Some(title) = self.config.discover_workspace_config().map(|c| c.progress_label.clone()) else { return; }; Defensive patterns
Strategy: fallback
Validate before calling
// server-side guard: only report progress while discovery is still configured
let Some(cfg) = self.config.discover_workspace_config() else { return; };
let title = cfg.progress_label.clone(); Type guard
fn discovery_active(cfg: &Config) -> bool {
cfg.discover_workspace_config().is_some()
} Prevention
- Reload the window after changing discoverWorkspaceConfig so stale discovery processes die.
- Do not remove the discovery config while a discovery run is in flight.
- Kill orphaned discovery command processes after settings changes.
- Keep the progress_label configured whenever discovery is enabled.
When it happens
Trigger: A DiscoverProjectMessage (Started/Progress/Finished) arrives from a previously spawned discovery process after the user cleared rust.analyzer.workspace.discoverConfig (or the config was reloaded without it), so config.discover_workspace_config() returns None.
Common situations: Changing rust-analyzer settings mid-session while a project discovery run is in flight, switching workspace folders so the config lookup no longer matches, and stale discovery processes from before a settings reload.
Related errors
- Unable to get AbsPath
- received response for unknown request
- we never provide completions for excluded files
- we never provide code actions for excluded files
- unable to get FileId
AI-assisted analysis of rust-lang/rust-analyzer@e8f7e90aa3 (2026-09-03).
Data as JSON: /api/errors/1bf27be32484f974.
Report an issue: GitHub.