{"record":{"id":"1bf27be32484f974","repo":"rust-lang/rust-analyzer","slug":"no-title-could-be-found-this-is-a-bug","errorCode":null,"errorMessage":"No title could be found; this is a bug","messagePattern":"No title could be found; this is a bug","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rust-analyzer/src/main_loop.rs","lineNumber":1135,"sourceCode":"                                    analysis.is_proc_macro_crate(krate).is_ok_and(|it| it)\n                                }),\n                                _ => false,\n                            }\n                        }) {\n                            sender.send(Task::BuildDepsHaveChanged).unwrap();\n                        }\n                    }\n                });\n            }\n        }\n    }\n\n    fn handle_discover_msg(&mut self, message: DiscoverProjectMessage) {\n        let title = self\n            .config\n            .discover_workspace_config()\n            .map(|cfg| cfg.progress_label.clone())\n            .expect(\"No title could be found; this is a bug\");\n        match message {\n            DiscoverProjectMessage::Finished { project, buildfile } => {\n                self.discover_jobs_active = self.discover_jobs_active.saturating_sub(1);\n                if self.discover_jobs_active == 0 {\n                    self.report_progress(&title, Progress::End, None, None, None);\n                }\n\n                let mut config = Config::clone(&*self.config);\n                config.add_discovered_project_from_command(project, buildfile);\n                self.update_configuration(config);\n            }\n            DiscoverProjectMessage::Progress { message } => {\n                if self.discover_jobs_active > 0 {\n                    self.report_progress(&title, Progress::Report, Some(message), None, None)\n                }\n            }\n            DiscoverProjectMessage::Error { error, source } => {\n                let message = format!(\"Project discovery failed: {error}\");","sourceCodeStart":1117,"sourceCodeEnd":1153,"githubUrl":"https://github.com/rust-lang/rust-analyzer/blob/e8f7e90aa3e7b26aa9a000200f606c1078da99ec/crates/rust-analyzer/src/main_loop.rs#L1117-L1153","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nlet title = self.config.discover_workspace_config()\n    .map(|cfg| cfg.progress_label.clone())\n    .expect(\"No title could be found; this is a bug\");\n// after: tolerate config change mid-discovery\nlet Some(title) = self.config.discover_workspace_config().map(|c| c.progress_label.clone()) else { return; };","handlingStrategy":"fallback","validationCode":"// server-side guard: only report progress while discovery is still configured\nlet Some(cfg) = self.config.discover_workspace_config() else { return; };\nlet title = cfg.progress_label.clone();","typeGuard":"fn discovery_active(cfg: &Config) -> bool {\n    cfg.discover_workspace_config().is_some()\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["lsp","workspace-discovery","panic","config-reload","progress"],"backgroundTag":"stale-discovery-progress-message","analyzedSha":"e8f7e90aa3e7b26aa9a000200f606c1078da99ec","analyzedAt":"2026-09-03T21:08:06.959Z","contentChangedAt":"2026-09-03T21:08:06.959Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}