{"record":{"id":"7b40413016e50f34","repo":"zed-industries/zed","slug":"invalid-relative-path-component-component","errorCode":null,"errorMessage":"invalid relative path component: {component:?}","messagePattern":"invalid relative path component: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/path/src/rel_path.rs","lineNumber":358,"sourceCode":"            self.0.clear();\n            true\n        } else {\n            false\n        }\n    }\n\n    pub fn push(&mut self, path: &RelPath) {\n        if path.is_empty() {\n            return;\n        }\n        if !self.is_empty() {\n            self.0.push('/');\n        }\n        self.0.push_str(&path.0);\n    }\n\n    pub fn push_component(&mut self, component: &str) -> Result<()> {\n        anyhow::ensure!(\n            !component.is_empty()\n                && !component.contains('/')\n                && component != \".\"\n                && component != \"..\",\n            \"invalid relative path component: {component:?}\"\n        );\n\n        if !self.is_empty() {\n            self.0.push('/');\n        }\n        self.0.push_str(component);\n        Ok(())\n    }\n\n    pub fn as_rel_path(&self) -> &RelPath {\n        RelPath::from_str(self.0.as_str())\n    }\n","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/path/src/rel_path.rs#L340-L376","documentation":"RelPathBuf::push_component rejected the component because it is empty, contains '/', or equals '.' or '..'. Components must be single path segments so that pushing preserves the normalized-relative invariant of the buffer.","triggerScenarios":"Thrown at crates/path/src/rel_path.rs:358 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Split multi-segment inputs and push each segment separately","Sanitize user-derived strings (e.g. names, ids used as path segments) before pushing","Reject empty or traversal components at the input boundary"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}