{"record":{"id":"5e59cc5c82a9b764","repo":"oven-sh/bun","slug":"cannot-move-an-empty-result-this-is-a-bug-in-bun","errorCode":null,"errorMessage":"Cannot move an empty Result. This is a bug in Bun. Please report this issue on GitHub.","messagePattern":"Cannot move an empty Result\\. This is a bug in Bun\\. Please report this issue on GitHub\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/install/hosted_git_info.rs","lineNumber":1013,"sourceCode":"\n// Uses `Range<usize>` into `_owned_buffer` rather than self-referential\n// slices (see the HostedGitInfo struct-level note).\npub(crate) struct ExtractResult {\n    pub(crate) user: Option<Range<usize>>,\n    pub(crate) project: Range<usize>,\n    pub(crate) committish: Option<Range<usize>>,\n    _owned_buffer: Option<Box<[u8]>>,\n}\n\nimpl ExtractResult {\n    /// Return the buffer which owns this Result and the allocator responsible for\n    /// freeing it.\n    ///\n    /// Same semantics as C++ STL. Safe-to-deinit Result after this, not safe to\n    /// use it.\n    fn move_out(&mut self) -> Box<[u8]> {\n        let Some(buffer) = self._owned_buffer.take() else {\n            panic!(\n                \"Cannot move an empty Result. This is a bug in Bun. Please \\\n                 report this issue on GitHub.\"\n            );\n        };\n        buffer\n    }\n}\n\n/// Encapsulates all the various foramtters that different hosts may have. Usually this has\n/// to do with URLs, but could be other things.\npub(crate) mod formatters {\n    use super::*;\n\n    /// Mirrors hosts.js's extract function\n    pub(crate) mod extract {\n        use super::*;\n\n        pub(crate) type Type =","sourceCodeStart":995,"sourceCodeEnd":1031,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/install/hosted_git_info.rs#L995-L1031","documentation":"Error \"Cannot move an empty Result. This is a bug in Bun. Please report this issue on GitHub.\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at src/install/hosted_git_info.rs:1013 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":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}