{"record":{"id":"456b1cb313a077a0","repo":"iced-rs/iced","slug":"caches-must-not-be-empty","errorCode":null,"errorMessage":"Caches must not be empty","messagePattern":"Caches must not be empty","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"highlighter/src/lib.rs","lineNumber":89,"sourceCode":"            self.current_line = snapshot * LINES_PER_SNAPSHOT;\n        } else {\n            self.caches.truncate(1);\n            self.current_line = 0;\n        }\n\n        let (parser, stack) = self.caches.last().cloned().unwrap_or_else(|| {\n            (\n                parsing::ParseState::new(self.syntax),\n                parsing::ScopeStack::new(),\n            )\n        });\n\n        self.caches.push((parser, stack));\n    }\n\n    fn highlight_line(&mut self, line: &str) -> Self::Iterator<'_> {\n        if self.current_line / LINES_PER_SNAPSHOT >= self.caches.len() {\n            let (parser, stack) = self.caches.last().expect(\"Caches must not be empty\");\n\n            self.caches.push((parser.clone(), stack.clone()));\n        }\n\n        self.current_line += 1;\n\n        let (parser, stack) = self.caches.last_mut().expect(\"Caches must not be empty\");\n\n        let ops = parser.parse_line(line, &SYNTAXES).unwrap_or_default();\n\n        Box::new(scope_iterator(ops, line, stack, &self.highlighter))\n    }\n\n    fn current_line(&self) -> usize {\n        self.current_line\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/iced-rs/iced/blob/2cffa99b395d84fe469b44dccb56bbacd2f1a157/highlighter/src/lib.rs#L71-L107","documentation":"Error \"Caches must not be empty\" thrown in iced-rs/iced.","triggerScenarios":"Thrown at highlighter/src/lib.rs:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2cffa99b395d84fe469b44dccb56bbacd2f1a157","analyzedAt":"2026-08-16T19:41:49.083Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}