{"record":{"id":"96797e843b78cf76","repo":"GitoxideLabs/gitoxide","slug":"this-impl-is-needed-to-allow-passing-a-known-valid-96797e","errorCode":null,"errorMessage":"this impl is needed to allow passing a known valid partial path as parameter","messagePattern":"this impl is needed to allow passing a known valid partial path as parameter","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"gix-ref/src/store/packed/find.rs","lineNumber":115,"sourceCode":"    }\n}\n\nmod error {\n    use std::convert::Infallible;\n\n    /// The error returned by [`find()`][super::packed::Buffer::find()]\n    #[derive(Debug, thiserror::Error)]\n    #[expect(missing_docs)]\n    pub enum Error {\n        #[error(\"The ref name or path is not a valid ref name\")]\n        RefnameValidation(#[from] crate::name::Error),\n        #[error(\"The reference could not be parsed\")]\n        Parse,\n    }\n\n    impl From<Infallible> for Error {\n        fn from(_: Infallible) -> Self {\n            unreachable!(\"this impl is needed to allow passing a known valid partial path as parameter\")\n        }\n    }\n}\npub use error::Error;\n\n///\npub mod existing {\n\n    /// The error returned by [`find_existing()`][super::packed::Buffer::find()]\n    #[derive(Debug, thiserror::Error)]\n    #[expect(missing_docs)]\n    pub enum Error {\n        #[error(\"The find operation failed\")]\n        Find(#[from] super::Error),\n        #[error(\"The reference did not exist even though that was expected\")]\n        NotFound,\n    }\n}","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-ref/src/store/packed/find.rs#L97-L133","documentation":"Identical pattern to the general-store variant: a `From<Infallible>` impl on the packed-ref find error enum in `gix-ref` whose body is `unreachable!()`. It allows infallibly-convertible types (e.g. `&str`) to be passed where a `TryInto<&PartialNameRef>` is expected, satisfying the `Error: From<E>` bound. It can never actually be invoked because `Infallible` has no values.","triggerScenarios":"Never triggered at runtime. Reaching it would require constructing an `Infallible` value, which the type system forbids.","commonSituations":"Seen when reading gix-ref packed-ref lookup code or when explaining why a generic call site with an infallible conversion compiles.","solutions":["Do nothing; this error can never be produced at runtime.","If this panic is ever observed, it is a compiler-level impossibility indicating a serious bug — report it to the gitoxide project."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["No defense needed: `Infallible` is uninhabited, so the `unreachable!()` branch cannot execute.","Report upstream if ever observed — it would imply a broken compiler or unsafe misuse."],"tags":["rust","unreachable","type-system","gix-ref"],"backgroundTag":"internal-invariant-violation","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}