GitoxideLabs/gitoxide · info
this impl is needed to allow passing a known valid partial…
Error message
this impl is needed to allow passing a known valid partial path as parameter
What it means
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.
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.
Defensive patterns
Strategy: validation
Prevention
- 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.
When it happens
Trigger: Never triggered at runtime. Reaching it would require constructing an `Infallible` value, which the type system forbids.
Common situations: Seen when reading gix-ref packed-ref lookup code or when explaining why a generic call site with an infallible conversion compiles.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- this impl is needed to allow passing a known valid partial…
- BUG: packed refs cannot contain symbolic refs, catch that…
- this impl is needed to allow passing a known valid partial…
- name conversion infallible
- always with parent directory
AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08).
Data as JSON: /api/errors/96797e843b78cf76.
Report an issue: GitHub.
Appendix: source
Thrown at gix-ref/src/store/packed/find.rs:115
}
}
mod error {
use std::convert::Infallible;
/// The error returned by [`find()`][super::packed::Buffer::find()]
#[derive(Debug, thiserror::Error)]
#[expect(missing_docs)]
pub enum Error {
#[error("The ref name or path is not a valid ref name")]
RefnameValidation(#[from] crate::name::Error),
#[error("The reference could not be parsed")]
Parse,
}
impl From<Infallible> for Error {
fn from(_: Infallible) -> Self {
unreachable!("this impl is needed to allow passing a known valid partial path as parameter")
}
}
}
pub use error::Error;
///
pub mod existing {
/// The error returned by [`find_existing()`][super::packed::Buffer::find()]
#[derive(Debug, thiserror::Error)]
#[expect(missing_docs)]
pub enum Error {
#[error("The find operation failed")]
Find(#[from] super::Error),
#[error("The reference did not exist even though that was expected")]
NotFound,
}
}View on GitHub (pinned to e73179060b)